Package net.minecraft.core
Record Class GlobalPos
java.lang.Object
java.lang.Record
net.minecraft.core.GlobalPos
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<GlobalPos> private final ResourceKey
<Level> The field for thedimension
record component.static final com.mojang.serialization.MapCodec
<GlobalPos> private final BlockPos
The field for thepos
record component.static final StreamCodec
<io.netty.buffer.ByteBuf, GlobalPos> -
Constructor Summary
ConstructorDescriptionGlobalPos
(ResourceKey<Level> dimension, BlockPos pos) Creates an instance of aGlobalPos
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedimension
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static GlobalPos
of
(ResourceKey<Level> p_122644_, BlockPos p_122645_) pos()
Returns the value of thepos
record component.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. -
MAP_CODEC
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
GlobalPos
Creates an instance of aGlobalPos
record class.- Parameters:
dimension
- the value for thedimension
record componentpos
- the value for thepos
record 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 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
-