Class ChunkPos

java.lang.Object
net.minecraft.util.math.ChunkPos

public class ChunkPos extends Object
An immutable pair of two integers representing the X and Z coordinates of a chunk.

Chunk positions are usually serialized as a long.

Mappings:
Namespace Name
named net/minecraft/util/math/ChunkPos
intermediary net/minecraft/class_1923
official dgn
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<ChunkPos> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/util/math/ChunkPos;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_54241 Lnet/minecraft/class_1923;field_54241:Lcom/mojang/serialization/Codec;
      official a Ldgn;a:Lcom/mojang/serialization/Codec;
    • PACKET_CODEC

      public static final PacketCodec<ByteBuf,ChunkPos> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/util/math/ChunkPos;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_54242 Lnet/minecraft/class_1923;field_54242:Lnet/minecraft/class_9139;
      official b Ldgn;b:Lzt;
    • field_36299

      private static final int field_36299
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_36299 Lnet/minecraft/util/math/ChunkPos;field_36299:I
      intermediary field_36299 Lnet/minecraft/class_1923;field_36299:I
      official j Ldgn;j:I
    • MARKER

      public static final long MARKER
      A long-serialized chunk position 1875066, 1875066. This is a special value used as a marker.
      Mappings:
      Namespace Name Mixin selector
      named MARKER Lnet/minecraft/util/math/ChunkPos;MARKER:J
      intermediary field_17348 Lnet/minecraft/class_1923;field_17348:J
      official c Ldgn;c:J
    • field_54976

      private static final int field_54976
      Mappings:
      Namespace Name Mixin selector
      named field_54976 Lnet/minecraft/util/math/ChunkPos;field_54976:I
      intermediary field_54976 Lnet/minecraft/class_1923;field_54976:I
      official k Ldgn;k:I
    • MAX_COORDINATE

      public static final int MAX_COORDINATE
      Mappings:
      Namespace Name Mixin selector
      named MAX_COORDINATE Lnet/minecraft/util/math/ChunkPos;MAX_COORDINATE:I
      intermediary field_54975 Lnet/minecraft/class_1923;field_54975:I
      official d Ldgn;d:I
    • ORIGIN

      public static final ChunkPos ORIGIN
      The origin of the chunk position, 0, 0.
      Mappings:
      Namespace Name Mixin selector
      named ORIGIN Lnet/minecraft/util/math/ChunkPos;ORIGIN:Lnet/minecraft/util/math/ChunkPos;
      intermediary field_35107 Lnet/minecraft/class_1923;field_35107:Lnet/minecraft/class_1923;
      official e Ldgn;e:Ldgn;
    • field_30953

      private static final long field_30953
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_30953 Lnet/minecraft/util/math/ChunkPos;field_30953:J
      intermediary field_30953 Lnet/minecraft/class_1923;field_30953:J
      official l Ldgn;l:J
    • field_30954

      private static final long field_30954
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_30954 Lnet/minecraft/util/math/ChunkPos;field_30954:J
      intermediary field_30954 Lnet/minecraft/class_1923;field_30954:J
      official m Ldgn;m:J
    • field_30955

      private static final int field_30955
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_30955 Lnet/minecraft/util/math/ChunkPos;field_30955:I
      intermediary field_30955 Lnet/minecraft/class_1923;field_30955:I
      official n Ldgn;n:I
    • field_38224

      public static final int field_38224
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_38224 Lnet/minecraft/util/math/ChunkPos;field_38224:I
      intermediary field_38224 Lnet/minecraft/class_1923;field_38224:I
      official f Ldgn;f:I
    • field_30956

      private static final int field_30956
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_30956 Lnet/minecraft/util/math/ChunkPos;field_30956:I
      intermediary field_30956 Lnet/minecraft/class_1923;field_30956:I
      official o Ldgn;o:I
    • field_38225

      public static final int field_38225
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_38225 Lnet/minecraft/util/math/ChunkPos;field_38225:I
      intermediary field_38225 Lnet/minecraft/class_1923;field_38225:I
      official g Ldgn;g:I
    • field_30957

      private static final int field_30957
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_30957 Lnet/minecraft/util/math/ChunkPos;field_30957:I
      intermediary field_30957 Lnet/minecraft/class_1923;field_30957:I
      official p Ldgn;p:I
    • field_30958

      private static final int field_30958
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_30958 Lnet/minecraft/util/math/ChunkPos;field_30958:I
      intermediary field_30958 Lnet/minecraft/class_1923;field_30958:I
      official q Ldgn;q:I
    • field_30959

      private static final int field_30959
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_30959 Lnet/minecraft/util/math/ChunkPos;field_30959:I
      intermediary field_30959 Lnet/minecraft/class_1923;field_30959:I
      official r Ldgn;r:I
    • x

      public final int x
      Mappings:
      Namespace Name Mixin selector
      named x Lnet/minecraft/util/math/ChunkPos;x:I
      intermediary field_9181 Lnet/minecraft/class_1923;field_9181:I
      official h Ldgn;h:I
    • z

      public final int z
      Mappings:
      Namespace Name Mixin selector
      named z Lnet/minecraft/util/math/ChunkPos;z:I
      intermediary field_9180 Lnet/minecraft/class_1923;field_9180:I
      official i Ldgn;i:I
  • Constructor Details

    • ChunkPos

      public ChunkPos(int x, int z)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/util/math/ChunkPos;<init>(II)V
      intermediary <init> Lnet/minecraft/class_1923;<init>(II)V
      official <init> Ldgn;<init>(II)V
    • ChunkPos

      public ChunkPos(BlockPos pos)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/util/math/ChunkPos;<init>(Lnet/minecraft/util/math/BlockPos;)V
      intermediary <init> Lnet/minecraft/class_1923;<init>(Lnet/minecraft/class_2338;)V
      official <init> Ldgn;<init>(Ljh;)V
    • ChunkPos

      public ChunkPos(long pos)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/util/math/ChunkPos;<init>(J)V
      intermediary <init> Lnet/minecraft/class_1923;<init>(J)V
      official <init> Ldgn;<init>(J)V
  • Method Details

    • fromRegion

      public static ChunkPos fromRegion(int x, int z)
      Mappings:
      Namespace Name Mixin selector
      named fromRegion Lnet/minecraft/util/math/ChunkPos;fromRegion(II)Lnet/minecraft/util/math/ChunkPos;
      intermediary method_42305 Lnet/minecraft/class_1923;method_42305(II)Lnet/minecraft/class_1923;
      official a Ldgn;a(II)Ldgn;
    • fromRegionCenter

      public static ChunkPos fromRegionCenter(int x, int z)
      Mappings:
      Namespace Name Mixin selector
      named fromRegionCenter Lnet/minecraft/util/math/ChunkPos;fromRegionCenter(II)Lnet/minecraft/util/math/ChunkPos;
      intermediary method_42306 Lnet/minecraft/class_1923;method_42306(II)Lnet/minecraft/class_1923;
      official b Ldgn;b(II)Ldgn;
    • toLong

      public long toLong()
      Returns the chunk position serialized as long.
      Returns:
      the chunk position serialized as long
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named toLong Lnet/minecraft/util/math/ChunkPos;toLong()J
      intermediary method_8324 Lnet/minecraft/class_1923;method_8324()J
      official a Ldgn;a()J
    • toLong

      public static long toLong(int chunkX, int chunkZ)
      Returns the chunk position serialized as long.

      This returns chunkX | (chunkZ << 32).

      Returns:
      the chunk position serialized as long
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named toLong Lnet/minecraft/util/math/ChunkPos;toLong(II)J
      intermediary method_8331 Lnet/minecraft/class_1923;method_8331(II)J
      official c Ldgn;c(II)J
    • toLong

      public static long toLong(BlockPos pos)
      Returns the chunk position of the given pos serialized as long.
      Returns:
      the chunk position of the given pos serialized as long
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named toLong Lnet/minecraft/util/math/ChunkPos;toLong(Lnet/minecraft/util/math/BlockPos;)J
      intermediary method_37232 Lnet/minecraft/class_1923;method_37232(Lnet/minecraft/class_2338;)J
      official a Ldgn;a(Ljh;)J
    • getPackedX

      public static int getPackedX(long pos)
      Mappings:
      Namespace Name Mixin selector
      named getPackedX Lnet/minecraft/util/math/ChunkPos;getPackedX(J)I
      intermediary method_8325 Lnet/minecraft/class_1923;method_8325(J)I
      official a Ldgn;a(J)I
    • getPackedZ

      public static int getPackedZ(long pos)
      Mappings:
      Namespace Name Mixin selector
      named getPackedZ Lnet/minecraft/util/math/ChunkPos;getPackedZ(J)I
      intermediary method_8332 Lnet/minecraft/class_1923;method_8332(J)I
      official b Ldgn;b(J)I
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • hashCode

      public static int hashCode(int x, int z)
      Mappings:
      Namespace Name Mixin selector
      named hashCode Lnet/minecraft/util/math/ChunkPos;hashCode(II)I
      intermediary method_42307 Lnet/minecraft/class_1923;method_42307(II)I
      official d Ldgn;d(II)I
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
      Mappings:
      Namespace Name Mixin selector
      named equals Lnet/minecraft/util/math/ChunkPos;equals(Ljava/lang/Object;)Z
      intermediary equals Lnet/minecraft/class_1923;equals(Ljava/lang/Object;)Z
      official equals Ldgn;equals(Ljava/lang/Object;)Z
    • getCenterX

      public int getCenterX()
      Mappings:
      Namespace Name Mixin selector
      named getCenterX Lnet/minecraft/util/math/ChunkPos;getCenterX()I
      intermediary method_33940 Lnet/minecraft/class_1923;method_33940()I
      official b Ldgn;b()I
    • getCenterZ

      public int getCenterZ()
      Mappings:
      Namespace Name Mixin selector
      named getCenterZ Lnet/minecraft/util/math/ChunkPos;getCenterZ()I
      intermediary method_33942 Lnet/minecraft/class_1923;method_33942()I
      official c Ldgn;c()I
    • getStartX

      public int getStartX()
      Mappings:
      Namespace Name Mixin selector
      named getStartX Lnet/minecraft/util/math/ChunkPos;getStartX()I
      intermediary method_8326 Lnet/minecraft/class_1923;method_8326()I
      official d Ldgn;d()I
    • getStartZ

      public int getStartZ()
      Mappings:
      Namespace Name Mixin selector
      named getStartZ Lnet/minecraft/util/math/ChunkPos;getStartZ()I
      intermediary method_8328 Lnet/minecraft/class_1923;method_8328()I
      official e Ldgn;e()I
    • getEndX

      public int getEndX()
      Mappings:
      Namespace Name Mixin selector
      named getEndX Lnet/minecraft/util/math/ChunkPos;getEndX()I
      intermediary method_8327 Lnet/minecraft/class_1923;method_8327()I
      official f Ldgn;f()I
    • getEndZ

      public int getEndZ()
      Mappings:
      Namespace Name Mixin selector
      named getEndZ Lnet/minecraft/util/math/ChunkPos;getEndZ()I
      intermediary method_8329 Lnet/minecraft/class_1923;method_8329()I
      official g Ldgn;g()I
    • getRegionX

      public int getRegionX()
      Mappings:
      Namespace Name Mixin selector
      named getRegionX Lnet/minecraft/util/math/ChunkPos;getRegionX()I
      intermediary method_17885 Lnet/minecraft/class_1923;method_17885()I
      official h Ldgn;h()I
    • getRegionZ

      public int getRegionZ()
      Mappings:
      Namespace Name Mixin selector
      named getRegionZ Lnet/minecraft/util/math/ChunkPos;getRegionZ()I
      intermediary method_17886 Lnet/minecraft/class_1923;method_17886()I
      official i Ldgn;i()I
    • getRegionRelativeX

      public int getRegionRelativeX()
      Mappings:
      Namespace Name Mixin selector
      named getRegionRelativeX Lnet/minecraft/util/math/ChunkPos;getRegionRelativeX()I
      intermediary method_17887 Lnet/minecraft/class_1923;method_17887()I
      official j Ldgn;j()I
    • getRegionRelativeZ

      public int getRegionRelativeZ()
      Mappings:
      Namespace Name Mixin selector
      named getRegionRelativeZ Lnet/minecraft/util/math/ChunkPos;getRegionRelativeZ()I
      intermediary method_17888 Lnet/minecraft/class_1923;method_17888()I
      official k Ldgn;k()I
    • getBlockPos

      public BlockPos getBlockPos(int offsetX, int y, int offsetZ)
      Mappings:
      Namespace Name Mixin selector
      named getBlockPos Lnet/minecraft/util/math/ChunkPos;getBlockPos(III)Lnet/minecraft/util/math/BlockPos;
      intermediary method_35231 Lnet/minecraft/class_1923;method_35231(III)Lnet/minecraft/class_2338;
      official a Ldgn;a(III)Ljh;
    • getOffsetX

      public int getOffsetX(int offset)
      Mappings:
      Namespace Name Mixin selector
      named getOffsetX Lnet/minecraft/util/math/ChunkPos;getOffsetX(I)I
      intermediary method_33939 Lnet/minecraft/class_1923;method_33939(I)I
      official a Ldgn;a(I)I
    • getOffsetZ

      public int getOffsetZ(int offset)
      Mappings:
      Namespace Name Mixin selector
      named getOffsetZ Lnet/minecraft/util/math/ChunkPos;getOffsetZ(I)I
      intermediary method_33941 Lnet/minecraft/class_1923;method_33941(I)I
      official b Ldgn;b(I)I
    • getCenterAtY

      public BlockPos getCenterAtY(int y)
      Mappings:
      Namespace Name Mixin selector
      named getCenterAtY Lnet/minecraft/util/math/ChunkPos;getCenterAtY(I)Lnet/minecraft/util/math/BlockPos;
      intermediary method_33943 Lnet/minecraft/class_1923;method_33943(I)Lnet/minecraft/class_2338;
      official c Ldgn;c(I)Ljh;
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getStartPos

      public BlockPos getStartPos()
      Mappings:
      Namespace Name Mixin selector
      named getStartPos Lnet/minecraft/util/math/ChunkPos;getStartPos()Lnet/minecraft/util/math/BlockPos;
      intermediary method_8323 Lnet/minecraft/class_1923;method_8323()Lnet/minecraft/class_2338;
      official l Ldgn;l()Ljh;
    • getChebyshevDistance

      public int getChebyshevDistance(ChunkPos pos)
      Mappings:
      Namespace Name Mixin selector
      named getChebyshevDistance Lnet/minecraft/util/math/ChunkPos;getChebyshevDistance(Lnet/minecraft/util/math/ChunkPos;)I
      intermediary method_24022 Lnet/minecraft/class_1923;method_24022(Lnet/minecraft/class_1923;)I
      official a Ldgn;a(Ldgn;)I
    • getChebyshevDistance

      public int getChebyshevDistance(int x, int z)
      Mappings:
      Namespace Name Mixin selector
      named getChebyshevDistance Lnet/minecraft/util/math/ChunkPos;getChebyshevDistance(II)I
      intermediary method_60510 Lnet/minecraft/class_1923;method_60510(II)I
      official e Ldgn;e(II)I
    • getSquaredDistance

      public int getSquaredDistance(ChunkPos pos)
      Mappings:
      Namespace Name Mixin selector
      named getSquaredDistance Lnet/minecraft/util/math/ChunkPos;getSquaredDistance(Lnet/minecraft/util/math/ChunkPos;)I
      intermediary method_52566 Lnet/minecraft/class_1923;method_52566(Lnet/minecraft/class_1923;)I
      official b Ldgn;b(Ldgn;)I
    • getSquaredDistance

      public int getSquaredDistance(long pos)
      Mappings:
      Namespace Name Mixin selector
      named getSquaredDistance Lnet/minecraft/util/math/ChunkPos;getSquaredDistance(J)I
      intermediary method_52567 Lnet/minecraft/class_1923;method_52567(J)I
      official c Ldgn;c(J)I
    • getSquaredDistance

      private int getSquaredDistance(int x, int z)
      Mappings:
      Namespace Name Mixin selector
      named getSquaredDistance Lnet/minecraft/util/math/ChunkPos;getSquaredDistance(II)I
      intermediary method_52568 Lnet/minecraft/class_1923;method_52568(II)I
      official f Ldgn;f(II)I
    • stream

      public static Stream<ChunkPos> stream(ChunkPos center, int radius)
      Mappings:
      Namespace Name Mixin selector
      named stream Lnet/minecraft/util/math/ChunkPos;stream(Lnet/minecraft/util/math/ChunkPos;I)Ljava/util/stream/Stream;
      intermediary method_19280 Lnet/minecraft/class_1923;method_19280(Lnet/minecraft/class_1923;I)Ljava/util/stream/Stream;
      official a Ldgn;a(Ldgn;I)Ljava/util/stream/Stream;
    • stream

      public static Stream<ChunkPos> stream(ChunkPos pos1, ChunkPos pos2)
      Mappings:
      Namespace Name Mixin selector
      named stream Lnet/minecraft/util/math/ChunkPos;stream(Lnet/minecraft/util/math/ChunkPos;Lnet/minecraft/util/math/ChunkPos;)Ljava/util/stream/Stream;
      intermediary method_19281 Lnet/minecraft/class_1923;method_19281(Lnet/minecraft/class_1923;Lnet/minecraft/class_1923;)Ljava/util/stream/Stream;
      official a Ldgn;a(Ldgn;Ldgn;)Ljava/util/stream/Stream;