Package net.minecraft.world.level.portal
Record Class TeleportTransition
java.lang.Object
java.lang.Record
net.minecraft.world.level.portal.TeleportTransition
public record TeleportTransition(ServerLevel newLevel, Vec3 position, Vec3 deltaMovement, float yRot, float xRot, boolean missingRespawnBlock, boolean asPassenger, Set<Relative> relatives, TeleportTransition.PostTeleportTransition postTeleportTransition)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
The field for theasPassenger
record component.private final Vec3
The field for thedeltaMovement
record component.static final TeleportTransition.PostTeleportTransition
private final boolean
The field for themissingRespawnBlock
record component.private final ServerLevel
The field for thenewLevel
record component.static final TeleportTransition.PostTeleportTransition
static final TeleportTransition.PostTeleportTransition
private final Vec3
The field for theposition
record component.private final TeleportTransition.PostTeleportTransition
The field for thepostTeleportTransition
record component.The field for therelatives
record component.private final float
The field for thexRot
record component.private final float
The field for theyRot
record component. -
Constructor Summary
ConstructorsConstructorDescriptionTeleportTransition
(ServerLevel p_379938_, Entity p_379604_, TeleportTransition.PostTeleportTransition p_379683_) TeleportTransition
(ServerLevel newLevel, Vec3 position, Vec3 deltaMovement, float yRot, float xRot, boolean missingRespawnBlock, boolean asPassenger, Set<Relative> relatives, TeleportTransition.PostTeleportTransition postTeleportTransition) Creates an instance of aTeleportTransition
record class.TeleportTransition
(ServerLevel p_380133_, Vec3 p_379861_, Vec3 p_380308_, float p_379941_, float p_380119_, Set<Relative> p_379959_, TeleportTransition.PostTeleportTransition p_379425_) TeleportTransition
(ServerLevel p_379776_, Vec3 p_379412_, Vec3 p_379320_, float p_380257_, float p_379610_, TeleportTransition.PostTeleportTransition p_380303_) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the value of theasPassenger
record component.Returns the value of thedeltaMovement
record component.final boolean
Indicates whether some other object is "equal to" this one.private static Vec3
findAdjustedSharedSpawnPos
(ServerLevel p_379295_, Entity p_379825_) final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of themissingRespawnBlock
record component.static TeleportTransition
missingRespawnBlock
(ServerLevel p_380117_, Entity p_380173_, TeleportTransition.PostTeleportTransition p_380370_) newLevel()
Returns the value of thenewLevel
record component.private static void
placePortalTicket
(Entity p_379684_) private static void
playPortalSound
(Entity p_380322_) position()
Returns the value of theposition
record component.Returns the value of thepostTeleportTransition
record component.Returns the value of therelatives
record component.final String
toString()
Returns a string representation of this record class.withPosition
(Vec3 p_379914_) withRotation
(float p_380177_, float p_379582_) float
xRot()
Returns the value of thexRot
record component.float
yRot()
Returns the value of theyRot
record component.
-
Field Details
-
newLevel
The field for thenewLevel
record component. -
position
The field for theposition
record component. -
deltaMovement
The field for thedeltaMovement
record component. -
yRot
private final float yRotThe field for theyRot
record component. -
xRot
private final float xRotThe field for thexRot
record component. -
missingRespawnBlock
private final boolean missingRespawnBlockThe field for themissingRespawnBlock
record component. -
asPassenger
private final boolean asPassengerThe field for theasPassenger
record component. -
relatives
The field for therelatives
record component. -
postTeleportTransition
The field for thepostTeleportTransition
record component. -
DO_NOTHING
-
PLAY_PORTAL_SOUND
-
PLACE_PORTAL_TICKET
-
-
Constructor Details
-
TeleportTransition
public TeleportTransition(ServerLevel p_379776_, Vec3 p_379412_, Vec3 p_379320_, float p_380257_, float p_379610_, TeleportTransition.PostTeleportTransition p_380303_) -
TeleportTransition
public TeleportTransition(ServerLevel p_380133_, Vec3 p_379861_, Vec3 p_380308_, float p_379941_, float p_380119_, Set<Relative> p_379959_, TeleportTransition.PostTeleportTransition p_379425_) -
TeleportTransition
public TeleportTransition(ServerLevel p_379938_, Entity p_379604_, TeleportTransition.PostTeleportTransition p_379683_) -
TeleportTransition
public TeleportTransition(ServerLevel newLevel, Vec3 position, Vec3 deltaMovement, float yRot, float xRot, boolean missingRespawnBlock, boolean asPassenger, Set<Relative> relatives, TeleportTransition.PostTeleportTransition postTeleportTransition) Creates an instance of aTeleportTransition
record class.- Parameters:
newLevel
- the value for thenewLevel
record componentposition
- the value for theposition
record componentdeltaMovement
- the value for thedeltaMovement
record componentyRot
- the value for theyRot
record componentxRot
- the value for thexRot
record componentmissingRespawnBlock
- the value for themissingRespawnBlock
record componentasPassenger
- the value for theasPassenger
record componentrelatives
- the value for therelatives
record componentpostTeleportTransition
- the value for thepostTeleportTransition
record component
-
-
Method Details
-
playPortalSound
-
placePortalTicket
-
missingRespawnBlock
public static TeleportTransition missingRespawnBlock(ServerLevel p_380117_, Entity p_380173_, TeleportTransition.PostTeleportTransition p_380370_) -
withRotation
-
withPosition
-
transitionAsPassenger
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
newLevel
Returns the value of thenewLevel
record component.- Returns:
- the value of the
newLevel
record component
-
position
Returns the value of theposition
record component.- Returns:
- the value of the
position
record component
-
deltaMovement
Returns the value of thedeltaMovement
record component.- Returns:
- the value of the
deltaMovement
record component
-
yRot
public float yRot()Returns the value of theyRot
record component.- Returns:
- the value of the
yRot
record component
-
xRot
public float xRot()Returns the value of thexRot
record component.- Returns:
- the value of the
xRot
record component
-
missingRespawnBlock
public boolean missingRespawnBlock()Returns the value of themissingRespawnBlock
record component.- Returns:
- the value of the
missingRespawnBlock
record component
-
asPassenger
public boolean asPassenger()Returns the value of theasPassenger
record component.- Returns:
- the value of the
asPassenger
record component
-
relatives
Returns the value of therelatives
record component.- Returns:
- the value of the
relatives
record component
-
postTeleportTransition
Returns the value of thepostTeleportTransition
record component.- Returns:
- the value of the
postTeleportTransition
record component
-