Package net.minecraft.util.math
Class ChunkSectionPos
java.lang.Object
net.minecraft.util.math.Vec3i
net.minecraft.util.math.ChunkSectionPos
- All Implemented Interfaces:
Comparable<Vec3i>
public class ChunkSectionPos extends Vec3i
- Mappings:
Namespace Name official gqintermediary net/minecraft/class_4076named net/minecraft/util/math/ChunkSectionPos
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description privateChunkSectionPos(int x, int y, int z) -
Method Summary
Modifier and Type Method Description longasLong()static longasLong(int x, int y, int z)static ChunkSectionPosfrom(int x, int y, int z)Creates a chunk section position from its x-, y- and z-coordinates.static ChunkSectionPosfrom(long packed)Creates a chunk section position from its packed representation.static ChunkSectionPosfrom(Entity entity)static ChunkSectionPosfrom(BlockPos pos)static ChunkSectionPosfrom(ChunkPos chunkPos, int y)Creates a chunk section position from a chunk position and the y-coordinate of the vertical section.static ChunkSectionPosfrom(Chunk chunk)static longfromBlockPos(long blockPos)Gets the packed chunk section coordinate for a given packedBlockPos.static intgetBlockCoord(int sectionCoord)Converts the given chunk section coordinate to the world coordinate system.BlockPosgetCenterPos()static intgetLocalCoord(int coord)Converts a world coordinate to the local coordinate system (0-15) of its corresponding chunk section.intgetMaxX()intgetMaxY()intgetMaxZ()BlockPosgetMinPos()intgetMinX()intgetMinY()intgetMinZ()static intgetOffsetPos(int chunkCoord, int offset)static intgetSectionCoord(double coord)static intgetSectionCoord(int coord)Converts a world coordinate to the corresponding chunk-section coordinate.intgetSectionX()intgetSectionY()intgetSectionZ()static longoffset(long packed, int x, int y, int z)Offsets a packed chunk section position by the given offsets.static longoffset(long packed, Direction direction)Offsets a packed chunk section position in the given direction.static shortpackLocal(BlockPos pos)Returns the local position of the given block position relative to its respective chunk section, packed into a short.static Stream<ChunkSectionPos>stream(int minX, int minY, int minZ, int maxX, int maxY, int maxZ)static Stream<ChunkSectionPos>stream(ChunkPos center, int radius, int minY, int maxY)static Stream<ChunkSectionPos>stream(ChunkSectionPos center, int radius)Stream<BlockPos>streamBlocks()ChunkPostoChunkPos()static longtoLong(BlockPos pos)BlockPosunpackBlockPos(short packedLocalPos)Gets the world position of the given local position within this chunk section.intunpackBlockX(short packedLocalPos)Gets the world x-coordinate of the given local position within this chunk section.intunpackBlockY(short packedLocalPos)Gets the world y-coordinate of the given local position within this chunk section.intunpackBlockZ(short packedLocalPos)Gets the world z-coordinate of the given local position within this chunk section.static intunpackLocalX(short packedLocalPos)Gets the local x-coordinate from the given packed local position.static intunpackLocalY(short packedLocalPos)Gets the local y-coordinate from the given packed local position.static intunpackLocalZ(short packedLocalPos)Gets the local z-coordinate from the given packed local position.static intunpackX(long packed)Gets the chunk section x-coordinate from the given packed chunk section coordinate.static intunpackY(long packed)Gets the chunk section y-coordinate from the given packed chunk section coordinate.static intunpackZ(long packed)Gets the chunk section z-coordinate from the given packed chunk section coordinate.static longwithZeroY(long pos)Gets the packed chunk section coordinate at y=0 for the same chunk as the given packed chunk section coordinate.Methods inherited from class net.minecraft.util.math.Vec3i
compareTo, crossProduct, down, down, equals, getComponentAlongAxis, getManhattanDistance, getSquaredDistance, getSquaredDistance, getSquaredDistance, getSquaredDistance, getX, getY, getZ, hashCode, isWithinDistance, isWithinDistance, offset, setX, setY, setZ, toShortString, toString, up, up
-
Constructor Details
-
ChunkSectionPos
private ChunkSectionPos(int x, int y, int z)- Mappings:
Namespace Name Mixin selector official <init>Lgq;<init>(III)Vintermediary <init>Lnet/minecraft/class_4076;<init>(III)Vnamed <init>Lnet/minecraft/util/math/ChunkSectionPos;<init>(III)V
-
-
Method Details
-
from
Creates a chunk section position from its x-, y- and z-coordinates.- Mappings:
Namespace Name Mixin selector official aLgq;a(III)Lgq;intermediary method_18676Lnet/minecraft/class_4076;method_18676(III)Lnet/minecraft/class_4076;named fromLnet/minecraft/util/math/ChunkSectionPos;from(III)Lnet/minecraft/util/math/ChunkSectionPos;
-
from
- Mappings:
Namespace Name Mixin selector official aLgq;a(Lfx;)Lgq;intermediary method_18682Lnet/minecraft/class_4076;method_18682(Lnet/minecraft/class_2338;)Lnet/minecraft/class_4076;named fromLnet/minecraft/util/math/ChunkSectionPos;from(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/math/ChunkSectionPos;
-
from
Creates a chunk section position from a chunk position and the y-coordinate of the vertical section.- Mappings:
Namespace Name Mixin selector official aLgq;a(Lbta;I)Lgq;intermediary method_18681Lnet/minecraft/class_4076;method_18681(Lnet/minecraft/class_1923;I)Lnet/minecraft/class_4076;named fromLnet/minecraft/util/math/ChunkSectionPos;from(Lnet/minecraft/util/math/ChunkPos;I)Lnet/minecraft/util/math/ChunkSectionPos;
-
from
- Mappings:
Namespace Name Mixin selector official aLgq;a(Laqv;)Lgq;intermediary method_18680Lnet/minecraft/class_4076;method_18680(Lnet/minecraft/class_1297;)Lnet/minecraft/class_4076;named fromLnet/minecraft/util/math/ChunkSectionPos;from(Lnet/minecraft/entity/Entity;)Lnet/minecraft/util/math/ChunkSectionPos;
-
from
Creates a chunk section position from its packed representation.- See Also:
asLong(int, int, int)- Mappings:
Namespace Name Mixin selector official aLgq;a(J)Lgq;intermediary method_18677Lnet/minecraft/class_4076;method_18677(J)Lnet/minecraft/class_4076;named fromLnet/minecraft/util/math/ChunkSectionPos;from(J)Lnet/minecraft/util/math/ChunkSectionPos;
-
from
- Mappings:
Namespace Name Mixin selector official aLgq;a(Lcjl;)Lgq;intermediary method_33705Lnet/minecraft/class_4076;method_33705(Lnet/minecraft/class_2791;)Lnet/minecraft/class_4076;named fromLnet/minecraft/util/math/ChunkSectionPos;from(Lnet/minecraft/world/chunk/Chunk;)Lnet/minecraft/util/math/ChunkSectionPos;
-
offset
Offsets a packed chunk section position in the given direction.- See Also:
asLong(int, int, int)- Mappings:
Namespace Name Mixin selector official aLgq;a(JLgc;)Jintermediary method_18679Lnet/minecraft/class_4076;method_18679(JLnet/minecraft/class_2350;)Jnamed offsetLnet/minecraft/util/math/ChunkSectionPos;offset(JLnet/minecraft/util/math/Direction;)J
-
offset
public static long offset(long packed, int x, int y, int z)Offsets a packed chunk section position by the given offsets.- See Also:
asLong(int, int, int)- Mappings:
Namespace Name Mixin selector official aLgq;a(JIII)Jintermediary method_18678Lnet/minecraft/class_4076;method_18678(JIII)Jnamed offsetLnet/minecraft/util/math/ChunkSectionPos;offset(JIII)J
-
getSectionCoord
public static int getSectionCoord(double coord)- Mappings:
Namespace Name Mixin selector official aLgq;a(D)Iintermediary method_32204Lnet/minecraft/class_4076;method_32204(D)Inamed getSectionCoordLnet/minecraft/util/math/ChunkSectionPos;getSectionCoord(D)I
-
getSectionCoord
public static int getSectionCoord(int coord)Converts a world coordinate to the corresponding chunk-section coordinate.- Implementation Note:
- This implementation returns
coord / 16. - Mappings:
Namespace Name Mixin selector official aLgq;a(I)Iintermediary method_18675Lnet/minecraft/class_4076;method_18675(I)Inamed getSectionCoordLnet/minecraft/util/math/ChunkSectionPos;getSectionCoord(I)I
-
getLocalCoord
public static int getLocalCoord(int coord)Converts a world coordinate to the local coordinate system (0-15) of its corresponding chunk section.- Mappings:
Namespace Name Mixin selector official bLgq;b(I)Iintermediary method_18684Lnet/minecraft/class_4076;method_18684(I)Inamed getLocalCoordLnet/minecraft/util/math/ChunkSectionPos;getLocalCoord(I)I
-
packLocal
Returns the local position of the given block position relative to its respective chunk section, packed into a short.- Mappings:
Namespace Name Mixin selector official bLgq;b(Lfx;)Sintermediary method_19454Lnet/minecraft/class_4076;method_19454(Lnet/minecraft/class_2338;)Snamed packLocalLnet/minecraft/util/math/ChunkSectionPos;packLocal(Lnet/minecraft/util/math/BlockPos;)S
-
unpackLocalX
public static int unpackLocalX(short packedLocalPos)Gets the local x-coordinate from the given packed local position.- See Also:
packLocal(net.minecraft.util.math.BlockPos)- Mappings:
Namespace Name Mixin selector official aLgq;a(S)Iintermediary method_30551Lnet/minecraft/class_4076;method_30551(S)Inamed unpackLocalXLnet/minecraft/util/math/ChunkSectionPos;unpackLocalX(S)I
-
unpackLocalY
public static int unpackLocalY(short packedLocalPos)Gets the local y-coordinate from the given packed local position.- See Also:
packLocal(net.minecraft.util.math.BlockPos)- Mappings:
Namespace Name Mixin selector official bLgq;b(S)Iintermediary method_30552Lnet/minecraft/class_4076;method_30552(S)Inamed unpackLocalYLnet/minecraft/util/math/ChunkSectionPos;unpackLocalY(S)I
-
unpackLocalZ
public static int unpackLocalZ(short packedLocalPos)Gets the local z-coordinate from the given packed local position.- See Also:
packLocal(net.minecraft.util.math.BlockPos)- Mappings:
Namespace Name Mixin selector official cLgq;c(S)Iintermediary method_30553Lnet/minecraft/class_4076;method_30553(S)Inamed unpackLocalZLnet/minecraft/util/math/ChunkSectionPos;unpackLocalZ(S)I
-
unpackBlockX
public int unpackBlockX(short packedLocalPos)Gets the world x-coordinate of the given local position within this chunk section.- See Also:
packLocal(net.minecraft.util.math.BlockPos)- Mappings:
Namespace Name Mixin selector official dLgq;d(S)Iintermediary method_30554Lnet/minecraft/class_4076;method_30554(S)Inamed unpackBlockXLnet/minecraft/util/math/ChunkSectionPos;unpackBlockX(S)I
-
unpackBlockY
public int unpackBlockY(short packedLocalPos)Gets the world y-coordinate of the given local position within this chunk section.- See Also:
packLocal(net.minecraft.util.math.BlockPos)- Mappings:
Namespace Name Mixin selector official eLgq;e(S)Iintermediary method_30555Lnet/minecraft/class_4076;method_30555(S)Inamed unpackBlockYLnet/minecraft/util/math/ChunkSectionPos;unpackBlockY(S)I
-
unpackBlockZ
public int unpackBlockZ(short packedLocalPos)Gets the world z-coordinate of the given local position within this chunk section.- See Also:
packLocal(net.minecraft.util.math.BlockPos)- Mappings:
Namespace Name Mixin selector official fLgq;f(S)Iintermediary method_30556Lnet/minecraft/class_4076;method_30556(S)Inamed unpackBlockZLnet/minecraft/util/math/ChunkSectionPos;unpackBlockZ(S)I
-
unpackBlockPos
Gets the world position of the given local position within this chunk section.- See Also:
packLocal(net.minecraft.util.math.BlockPos)- Mappings:
Namespace Name Mixin selector official gLgq;g(S)Lfx;intermediary method_30557Lnet/minecraft/class_4076;method_30557(S)Lnet/minecraft/class_2338;named unpackBlockPosLnet/minecraft/util/math/ChunkSectionPos;unpackBlockPos(S)Lnet/minecraft/util/math/BlockPos;
-
getBlockCoord
public static int getBlockCoord(int sectionCoord)Converts the given chunk section coordinate to the world coordinate system. The returned coordinate will always be at the origin of the chunk section in world space.- Mappings:
Namespace Name Mixin selector official cLgq;c(I)Iintermediary method_18688Lnet/minecraft/class_4076;method_18688(I)Inamed getBlockCoordLnet/minecraft/util/math/ChunkSectionPos;getBlockCoord(I)I
-
getOffsetPos
public static int getOffsetPos(int chunkCoord, int offset)- Mappings:
Namespace Name Mixin selector official aLgq;a(II)Iintermediary method_32205Lnet/minecraft/class_4076;method_32205(II)Inamed getOffsetPosLnet/minecraft/util/math/ChunkSectionPos;getOffsetPos(II)I
-
unpackX
public static int unpackX(long packed)Gets the chunk section x-coordinate from the given packed chunk section coordinate.- See Also:
asLong(int, int, int)- Mappings:
Namespace Name Mixin selector official bLgq;b(J)Iintermediary method_18686Lnet/minecraft/class_4076;method_18686(J)Inamed unpackXLnet/minecraft/util/math/ChunkSectionPos;unpackX(J)I
-
unpackY
public static int unpackY(long packed)Gets the chunk section y-coordinate from the given packed chunk section coordinate.- See Also:
asLong(int, int, int)- Mappings:
Namespace Name Mixin selector official cLgq;c(J)Iintermediary method_18689Lnet/minecraft/class_4076;method_18689(J)Inamed unpackYLnet/minecraft/util/math/ChunkSectionPos;unpackY(J)I
-
unpackZ
public static int unpackZ(long packed)Gets the chunk section z-coordinate from the given packed chunk section coordinate.- See Also:
asLong(int, int, int)- Mappings:
Namespace Name Mixin selector official dLgq;d(J)Iintermediary method_18690Lnet/minecraft/class_4076;method_18690(J)Inamed unpackZLnet/minecraft/util/math/ChunkSectionPos;unpackZ(J)I
-
getSectionX
public int getSectionX()- Mappings:
Namespace Name Mixin selector official aLgq;a()Iintermediary method_18674Lnet/minecraft/class_4076;method_18674()Inamed getSectionXLnet/minecraft/util/math/ChunkSectionPos;getSectionX()I
-
getSectionY
public int getSectionY()- Mappings:
Namespace Name Mixin selector official bLgq;b()Iintermediary method_18683Lnet/minecraft/class_4076;method_18683()Inamed getSectionYLnet/minecraft/util/math/ChunkSectionPos;getSectionY()I
-
getSectionZ
public int getSectionZ()- Mappings:
Namespace Name Mixin selector official cLgq;c()Iintermediary method_18687Lnet/minecraft/class_4076;method_18687()Inamed getSectionZLnet/minecraft/util/math/ChunkSectionPos;getSectionZ()I
-
getMinX
public int getMinX()- Mappings:
Namespace Name Mixin selector official dLgq;d()Iintermediary method_19527Lnet/minecraft/class_4076;method_19527()Inamed getMinXLnet/minecraft/util/math/ChunkSectionPos;getMinX()I
-
getMinY
public int getMinY()- Mappings:
Namespace Name Mixin selector official eLgq;e()Iintermediary method_19528Lnet/minecraft/class_4076;method_19528()Inamed getMinYLnet/minecraft/util/math/ChunkSectionPos;getMinY()I
-
getMinZ
public int getMinZ()- Mappings:
Namespace Name Mixin selector official fLgq;f()Iintermediary method_19529Lnet/minecraft/class_4076;method_19529()Inamed getMinZLnet/minecraft/util/math/ChunkSectionPos;getMinZ()I
-
getMaxX
public int getMaxX()- Mappings:
Namespace Name Mixin selector official gLgq;g()Iintermediary method_19530Lnet/minecraft/class_4076;method_19530()Inamed getMaxXLnet/minecraft/util/math/ChunkSectionPos;getMaxX()I
-
getMaxY
public int getMaxY()- Mappings:
Namespace Name Mixin selector official hLgq;h()Iintermediary method_19531Lnet/minecraft/class_4076;method_19531()Inamed getMaxYLnet/minecraft/util/math/ChunkSectionPos;getMaxY()I
-
getMaxZ
public int getMaxZ()- Mappings:
Namespace Name Mixin selector official iLgq;i()Iintermediary method_19532Lnet/minecraft/class_4076;method_19532()Inamed getMaxZLnet/minecraft/util/math/ChunkSectionPos;getMaxZ()I
-
fromBlockPos
public static long fromBlockPos(long blockPos)Gets the packed chunk section coordinate for a given packedBlockPos.- See Also:
asLong(int, int, int),BlockPos.asLong()- Mappings:
Namespace Name Mixin selector official eLgq;e(J)Jintermediary method_18691Lnet/minecraft/class_4076;method_18691(J)Jnamed fromBlockPosLnet/minecraft/util/math/ChunkSectionPos;fromBlockPos(J)J
-
withZeroY
public static long withZeroY(long pos)Gets the packed chunk section coordinate at y=0 for the same chunk as the given packed chunk section coordinate.- See Also:
asLong(int, int, int)- Mappings:
Namespace Name Mixin selector official fLgq;f(J)Jintermediary method_18693Lnet/minecraft/class_4076;method_18693(J)Jnamed withZeroYLnet/minecraft/util/math/ChunkSectionPos;withZeroY(J)J
-
getMinPos
- Mappings:
Namespace Name Mixin selector official pLgq;p()Lfx;intermediary method_19767Lnet/minecraft/class_4076;method_19767()Lnet/minecraft/class_2338;named getMinPosLnet/minecraft/util/math/ChunkSectionPos;getMinPos()Lnet/minecraft/util/math/BlockPos;
-
getCenterPos
- Mappings:
Namespace Name Mixin selector official qLgq;q()Lfx;intermediary method_19768Lnet/minecraft/class_4076;method_19768()Lnet/minecraft/class_2338;named getCenterPosLnet/minecraft/util/math/ChunkSectionPos;getCenterPos()Lnet/minecraft/util/math/BlockPos;
-
toChunkPos
- Mappings:
Namespace Name Mixin selector official rLgq;r()Lbta;intermediary method_18692Lnet/minecraft/class_4076;method_18692()Lnet/minecraft/class_1923;named toChunkPosLnet/minecraft/util/math/ChunkSectionPos;toChunkPos()Lnet/minecraft/util/math/ChunkPos;
-
toLong
- Mappings:
Namespace Name Mixin selector official cLgq;c(Lfx;)Jintermediary method_33706Lnet/minecraft/class_4076;method_33706(Lnet/minecraft/class_2338;)Jnamed toLongLnet/minecraft/util/math/ChunkSectionPos;toLong(Lnet/minecraft/util/math/BlockPos;)J
-
asLong
public static long asLong(int x, int y, int z)- Mappings:
Namespace Name Mixin selector official bLgq;b(III)Jintermediary method_18685Lnet/minecraft/class_4076;method_18685(III)Jnamed asLongLnet/minecraft/util/math/ChunkSectionPos;asLong(III)J
-
asLong
public long asLong()- Mappings:
Namespace Name Mixin selector official sLgq;s()Jintermediary method_18694Lnet/minecraft/class_4076;method_18694()Jnamed asLongLnet/minecraft/util/math/ChunkSectionPos;asLong()J
-
streamBlocks
- Mappings:
Namespace Name Mixin selector official tLgq;t()Ljava/util/stream/Stream;intermediary method_19533Lnet/minecraft/class_4076;method_19533()Ljava/util/stream/Stream;named streamBlocksLnet/minecraft/util/math/ChunkSectionPos;streamBlocks()Ljava/util/stream/Stream;
-
stream
- Mappings:
Namespace Name Mixin selector official aLgq;a(Lgq;I)Ljava/util/stream/Stream;intermediary method_20439Lnet/minecraft/class_4076;method_20439(Lnet/minecraft/class_4076;I)Ljava/util/stream/Stream;named streamLnet/minecraft/util/math/ChunkSectionPos;stream(Lnet/minecraft/util/math/ChunkSectionPos;I)Ljava/util/stream/Stream;
-
stream
- Mappings:
Namespace Name Mixin selector official aLgq;a(Lbta;III)Ljava/util/stream/Stream;intermediary method_22446Lnet/minecraft/class_4076;method_22446(Lnet/minecraft/class_1923;III)Ljava/util/stream/Stream;named streamLnet/minecraft/util/math/ChunkSectionPos;stream(Lnet/minecraft/util/math/ChunkPos;III)Ljava/util/stream/Stream;
-
stream
public static Stream<ChunkSectionPos> stream(int minX, int minY, int minZ, int maxX, int maxY, int maxZ)- Mappings:
Namespace Name Mixin selector official aLgq;a(IIIIII)Ljava/util/stream/Stream;intermediary method_20438Lnet/minecraft/class_4076;method_20438(IIIIII)Ljava/util/stream/Stream;named streamLnet/minecraft/util/math/ChunkSectionPos;stream(IIIIII)Ljava/util/stream/Stream;
-