Package net.minecraft.server.level
Record Class ServerPlayer.RespawnConfig
java.lang.Object
java.lang.Record
net.minecraft.server.level.ServerPlayer.RespawnConfig
- Enclosing class:
ServerPlayer
public static record ServerPlayer.RespawnConfig(ResourceKey<Level> dimension, BlockPos pos, float angle, boolean forced)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatThe field for theanglerecord component.static final com.mojang.serialization.Codec<ServerPlayer.RespawnConfig> private final ResourceKey<Level> The field for thedimensionrecord component.private final booleanThe field for theforcedrecord component.private final BlockPosThe field for theposrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionRespawnConfig(ResourceKey<Level> dimension, BlockPos pos, float angle, boolean forced) Creates an instance of aRespawnConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatangle()Returns the value of theanglerecord component.Returns the value of thedimensionrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanforced()Returns the value of theforcedrecord component.static ResourceKey<Level> getDimensionOrDefault(ServerPlayer.RespawnConfig pRespawnConfig) final inthashCode()Returns a hash code value for this object.booleanisSamePosition(ServerPlayer.RespawnConfig pRespawnConfig) pos()Returns the value of theposrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
dimension
The field for thedimensionrecord component. -
pos
The field for theposrecord component. -
angle
private final float angleThe field for theanglerecord component. -
forced
private final boolean forcedThe field for theforcedrecord component. -
CODEC
-
-
Constructor Details
-
RespawnConfig
Creates an instance of aRespawnConfigrecord class.- Parameters:
dimension- the value for thedimensionrecord componentpos- the value for theposrecord componentangle- the value for theanglerecord componentforced- the value for theforcedrecord component
-
-
Method Details
-
getDimensionOrDefault
public static ResourceKey<Level> getDimensionOrDefault(@Nullable ServerPlayer.RespawnConfig pRespawnConfig) -
isSamePosition
-
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 '=='. -
dimension
Returns the value of thedimensionrecord component.- Returns:
- the value of the
dimensionrecord component
-
pos
Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
angle
public float angle()Returns the value of theanglerecord component.- Returns:
- the value of the
anglerecord component
-
forced
public boolean forced()Returns the value of theforcedrecord component.- Returns:
- the value of the
forcedrecord component
-