Record Class GlobalPos

java.lang.Object
java.lang.Record
net.minecraft.core.GlobalPos

public record GlobalPos(ResourceKey<Level> dimension, BlockPos pos) extends Record
  • Field Details

    • dimension

      private final ResourceKey<Level> dimension
      The field for the dimension record component.
    • pos

      private final BlockPos pos
      The field for the pos record component.
    • MAP_CODEC

      public static final com.mojang.serialization.MapCodec<GlobalPos> MAP_CODEC
    • CODEC

      public static final com.mojang.serialization.Codec<GlobalPos> CODEC
    • STREAM_CODEC

      public static final StreamCodec<io.netty.buffer.ByteBuf,GlobalPos> STREAM_CODEC
  • Constructor Details

    • GlobalPos

      public GlobalPos(ResourceKey<Level> dimension, BlockPos pos)
      Creates an instance of a GlobalPos record class.
      Parameters:
      dimension - the value for the dimension record component
      pos - the value for the pos record component
  • Method Details

    • of

      public static GlobalPos of(ResourceKey<Level> p_122644_, BlockPos p_122645_)
    • toString

      public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • dimension

      public ResourceKey<Level> dimension()
      Returns the value of the dimension record component.
      Returns:
      the value of the dimension record component
    • pos

      public BlockPos pos()
      Returns the value of the pos record component.
      Returns:
      the value of the pos record component