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 booleanThe field for theasPassengerrecord component.private final Vec3The field for thedeltaMovementrecord component.static final TeleportTransition.PostTeleportTransitionprivate final booleanThe field for themissingRespawnBlockrecord component.private final ServerLevelThe field for thenewLevelrecord component.static final TeleportTransition.PostTeleportTransitionstatic final TeleportTransition.PostTeleportTransitionprivate final Vec3The field for thepositionrecord component.private final TeleportTransition.PostTeleportTransitionThe field for thepostTeleportTransitionrecord component.The field for therelativesrecord component.private final floatThe field for thexRotrecord component.private final floatThe field for theyRotrecord 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 aTeleportTransitionrecord 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 TypeMethodDescriptionbooleanReturns the value of theasPassengerrecord component.Returns the value of thedeltaMovementrecord component.final booleanIndicates whether some other object is "equal to" this one.private static Vec3findAdjustedSharedSpawnPos(ServerLevel pLevel, Entity pEntity) final inthashCode()Returns a hash code value for this object.booleanReturns the value of themissingRespawnBlockrecord component.static TeleportTransitionmissingRespawnBlock(ServerLevel pLevel, Entity pEntity, TeleportTransition.PostTeleportTransition pPostTeleportTransition) newLevel()Returns the value of thenewLevelrecord component.private static voidplacePortalTicket(Entity pEntity) private static voidplayPortalSound(Entity pEntity) position()Returns the value of thepositionrecord component.Returns the value of thepostTeleportTransitionrecord component.Returns the value of therelativesrecord component.final StringtoString()Returns a string representation of this record class.withPosition(Vec3 pPosition) withRotation(float pYRot, float pXRot) floatxRot()Returns the value of thexRotrecord component.floatyRot()Returns the value of theyRotrecord component.
-
Field Details
-
newLevel
The field for thenewLevelrecord component. -
position
The field for thepositionrecord component. -
deltaMovement
The field for thedeltaMovementrecord component. -
yRot
private final float yRotThe field for theyRotrecord component. -
xRot
private final float xRotThe field for thexRotrecord component. -
missingRespawnBlock
private final boolean missingRespawnBlockThe field for themissingRespawnBlockrecord component. -
asPassenger
private final boolean asPassengerThe field for theasPassengerrecord component. -
relatives
The field for therelativesrecord component. -
postTeleportTransition
The field for thepostTeleportTransitionrecord 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 aTeleportTransitionrecord class.- Parameters:
newLevel- the value for thenewLevelrecord componentposition- the value for thepositionrecord componentdeltaMovement- the value for thedeltaMovementrecord componentyRot- the value for theyRotrecord componentxRot- the value for thexRotrecord componentmissingRespawnBlock- the value for themissingRespawnBlockrecord componentasPassenger- the value for theasPassengerrecord componentrelatives- the value for therelativesrecord componentpostTeleportTransition- the value for thepostTeleportTransitionrecord component
-
-
Method Details
-
playPortalSound
-
placePortalTicket
-
missingRespawnBlock
public static TeleportTransition missingRespawnBlock(ServerLevel pLevel, Entity pEntity, TeleportTransition.PostTeleportTransition pPostTeleportTransition) -
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 thenewLevelrecord component.- Returns:
- the value of the
newLevelrecord component
-
position
Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
deltaMovement
Returns the value of thedeltaMovementrecord component.- Returns:
- the value of the
deltaMovementrecord component
-
yRot
public float yRot()Returns the value of theyRotrecord component.- Returns:
- the value of the
yRotrecord component
-
xRot
public float xRot()Returns the value of thexRotrecord component.- Returns:
- the value of the
xRotrecord component
-
missingRespawnBlock
public boolean missingRespawnBlock()Returns the value of themissingRespawnBlockrecord component.- Returns:
- the value of the
missingRespawnBlockrecord component
-
asPassenger
public boolean asPassenger()Returns the value of theasPassengerrecord component.- Returns:
- the value of the
asPassengerrecord component
-
relatives
Returns the value of therelativesrecord component.- Returns:
- the value of the
relativesrecord component
-
postTeleportTransition
Returns the value of thepostTeleportTransitionrecord component.- Returns:
- the value of the
postTeleportTransitionrecord component
-