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> pDimension, BlockPos pPos, float pYaw, float pPitch) 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> pDimension, BlockPos pPos, float pYaw, float pPitch) -
dimension
-
pos
-
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 '=='. -
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
-