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.booleanisCloseEnough(ResourceKey<Level> dimension, BlockPos pos, int maxDistance) static GlobalPosof(ResourceKey<Level> dimension, BlockPos pos) 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
-
isCloseEnough
-
hashCode
-
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
-