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 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 newLevel, Vec3 pos, Vec3 speed, float yRot, float xRot, Set<Relative> relatives, TeleportTransition.PostTeleportTransition postTeleportTransition) TeleportTransition(ServerLevel newLevel, Vec3 pos, Vec3 speed, float yRot, float xRot, TeleportTransition.PostTeleportTransition postTeleportTransition) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theasPassengerrecord component.static TeleportTransitioncreateDefault(ServerPlayer player, TeleportTransition.PostTeleportTransition postTeleportTransition) Returns the value of thedeltaMovementrecord component.final booleanIndicates whether some other object is "equal to" this one.private static Vec3findAdjustedSharedSpawnPos(ServerLevel newLevel, Entity entity) final inthashCode()Returns a hash code value for this object.booleanReturns the value of themissingRespawnBlockrecord component.static TeleportTransitionmissingRespawnBlock(ServerPlayer player, TeleportTransition.PostTeleportTransition postTeleportTransition) newLevel()Returns the value of thenewLevelrecord component.private static voidplacePortalTicket(Entity entity) private static voidplayPortalSound(Entity entity) 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 position) withRotation(float yRot, float xRot) 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
-
postTeleportTransition
The field for thepostTeleportTransitionrecord component. -
DO_NOTHING
-
PLAY_PORTAL_SOUND
-
PLACE_PORTAL_TICKET
-
-
Constructor Details
-
TeleportTransition
public TeleportTransition(ServerLevel newLevel, Vec3 pos, Vec3 speed, float yRot, float xRot, TeleportTransition.PostTeleportTransition postTeleportTransition) -
TeleportTransition
public TeleportTransition(ServerLevel newLevel, Vec3 pos, Vec3 speed, float yRot, float xRot, Set<Relative> relatives, TeleportTransition.PostTeleportTransition postTeleportTransition) -
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
-
createDefault
public static TeleportTransition createDefault(ServerPlayer player, TeleportTransition.PostTeleportTransition postTeleportTransition) -
missingRespawnBlock
public static TeleportTransition missingRespawnBlock(ServerPlayer player, TeleportTransition.PostTeleportTransition postTeleportTransition) -
withRotation
-
withPosition
-
transitionAsPassenger
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
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
-
postTeleportTransition
Returns the value of thepostTeleportTransitionrecord component.- Returns:
- the value of the
postTeleportTransitionrecord component
-