Package net.minecraft.core
Record Class GlobalPos
java.lang.Object
java.lang.Record
net.minecraft.core.GlobalPos
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<GlobalPos> private final ResourceKey<Level> The field for thedimensionrecord component.static final com.mojang.serialization.MapCodec<GlobalPos> private final BlockPosThe field for theposrecord component.static final StreamCodec<io.netty.buffer.ByteBuf, GlobalPos> -
Constructor Summary
ConstructorsConstructorDescriptionGlobalPos(ResourceKey<Level> dimension, BlockPos pos) Creates an instance of aGlobalPosrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedimensionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static GlobalPosof(ResourceKey<Level> p_122644_, BlockPos p_122645_) pos()Returns the value of theposrecord component.toString()Returns a string representation of this record class.
-
Field Details
-
dimension
The field for thedimensionrecord component. -
pos
The field for theposrecord component. -
MAP_CODEC
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
GlobalPos
Creates an instance of aGlobalPosrecord class.- Parameters:
dimension- the value for thedimensionrecord componentpos- the value for theposrecord component
-
-
Method Details
-
of
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
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
-