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(LevelData.RespawnData respawnData, boolean forced)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ServerPlayer.RespawnConfig> private final booleanThe field for theforcedrecord component.private final LevelData.RespawnDataThe field for therespawnDatarecord component. -
Constructor Summary
ConstructorsConstructorDescriptionRespawnConfig(LevelData.RespawnData respawnData, boolean forced) Creates an instance of aRespawnConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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) Returns the value of therespawnDatarecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
respawnData
The field for therespawnDatarecord component. -
forced
private final boolean forcedThe field for theforcedrecord component. -
CODEC
-
-
Constructor Details
-
RespawnConfig
Creates an instance of aRespawnConfigrecord class.- Parameters:
respawnData- the value for therespawnDatarecord 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 '=='. -
respawnData
Returns the value of therespawnDatarecord component.- Returns:
- the value of the
respawnDatarecord component
-
forced
public boolean forced()Returns the value of theforcedrecord component.- Returns:
- the value of the
forcedrecord component
-