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 float
The field for theangle
record component.static final com.mojang.serialization.Codec
<ServerPlayer.RespawnConfig> private final ResourceKey
<Level> The field for thedimension
record component.private final boolean
The field for theforced
record component.private final BlockPos
The field for thepos
record component. -
Constructor Summary
ConstructorsConstructorDescriptionRespawnConfig
(ResourceKey<Level> dimension, BlockPos pos, float angle, boolean forced) Creates an instance of aRespawnConfig
record class. -
Method Summary
Modifier and TypeMethodDescriptionfloat
angle()
Returns the value of theangle
record component.Returns the value of thedimension
record component.final boolean
Indicates whether some other object is "equal to" this one.boolean
forced()
Returns the value of theforced
record component.static ResourceKey
<Level> getDimensionOrDefault
(ServerPlayer.RespawnConfig p_405808_) final int
hashCode()
Returns a hash code value for this object.boolean
isSamePosition
(ServerPlayer.RespawnConfig p_405205_) pos()
Returns the value of thepos
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
dimension
The field for thedimension
record component. -
pos
The field for thepos
record component. -
angle
private final float angleThe field for theangle
record component. -
forced
private final boolean forcedThe field for theforced
record component. -
CODEC
-
-
Constructor Details
-
RespawnConfig
Creates an instance of aRespawnConfig
record class.- Parameters:
dimension
- the value for thedimension
record componentpos
- the value for thepos
record componentangle
- the value for theangle
record componentforced
- the value for theforced
record component
-
-
Method Details
-
getDimensionOrDefault
public static ResourceKey<Level> getDimensionOrDefault(@Nullable ServerPlayer.RespawnConfig p_405808_) -
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 thedimension
record component.- Returns:
- the value of the
dimension
record component
-
pos
Returns the value of thepos
record component.- Returns:
- the value of the
pos
record component
-
angle
public float angle()Returns the value of theangle
record component.- Returns:
- the value of the
angle
record component
-
forced
public boolean forced()Returns the value of theforced
record component.- Returns:
- the value of the
forced
record component
-