Record Class LevelData.RespawnData
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.LevelData.RespawnData
- Enclosing interface:
LevelData
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<LevelData.RespawnData> static final LevelData.RespawnDataprivate final GlobalPosThe field for theglobalPosrecord component.static final com.mojang.serialization.MapCodec<LevelData.RespawnData> private final floatThe field for thepitchrecord component.static final StreamCodec<io.netty.buffer.ByteBuf, LevelData.RespawnData> private final floatThe field for theyawrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionRespawnData(GlobalPos globalPos, float yaw, float pitch) Creates an instance of aRespawnDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theglobalPosrecord component.final inthashCode()Returns a hash code value for this object.static LevelData.RespawnDataof(ResourceKey<Level> dimension, BlockPos pos, float yaw, float pitch) floatpitch()Returns the value of thepitchrecord component.pos()final StringtoString()Returns a string representation of this record class.floatyaw()Returns the value of theyawrecord component.
-
Field Details
-
globalPos
The field for theglobalPosrecord component. -
yaw
private final float yawThe field for theyawrecord component. -
pitch
private final float pitchThe field for thepitchrecord component. -
DEFAULT
-
MAP_CODEC
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
RespawnData
Creates an instance of aRespawnDatarecord class.- Parameters:
globalPos- the value for theglobalPosrecord componentyaw- the value for theyawrecord componentpitch- the value for thepitchrecord component
-
-
Method Details
-
of
public static LevelData.RespawnData of(ResourceKey<Level> dimension, BlockPos pos, float yaw, float pitch) -
dimension
-
pos
-
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. -
globalPos
Returns the value of theglobalPosrecord component.- Returns:
- the value of the
globalPosrecord component
-
yaw
public float yaw()Returns the value of theyawrecord component.- Returns:
- the value of the
yawrecord component
-
pitch
public float pitch()Returns the value of thepitchrecord component.- Returns:
- the value of the
pitchrecord component
-