Class SectionPos
java.lang.Object
net.minecraft.core.Vec3i
net.minecraft.core.SectionPos
- All Implemented Interfaces:
Comparable<Vec3i>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final longprivate static final intprivate static final longprivate static final intprivate static final longprivate static final intprivate static final intprivate static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final StreamCodec<io.netty.buffer.ByteBuf, SectionPos> private static final intprivate static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaroundAndAtBlockPos(int blockX, int blockY, int blockZ, it.unimi.dsi.fastutil.longs.LongConsumer sectionConsumer) static voidaroundAndAtBlockPos(long blockPos, it.unimi.dsi.fastutil.longs.LongConsumer sectionConsumer) static voidaroundAndAtBlockPos(BlockPos blockPos, it.unimi.dsi.fastutil.longs.LongConsumer sectionConsumer) static Stream<SectionPos> aroundChunk(ChunkPos center, int radius, int minSection, int maxSection) longasLong()static longasLong(int x, int y, int z) static longstatic Stream<SectionPos> betweenClosedStream(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) static longblockToSection(long blockNode) static intblockToSectionCoord(double coord) static intblockToSectionCoord(int blockCoord) static SectionPosbottomOf(ChunkAccess chunk) center()chunk()static Stream<SectionPos> cube(SectionPos center, int radius) static longgetZeroNode(int x, int z) static longgetZeroNode(long sectionNode) intintintintintintstatic SectionPosof(int x, int y, int z) static SectionPosof(long sectionNode) static SectionPosstatic SectionPosstatic SectionPosstatic SectionPosof(EntityAccess entity) offset(int x, int y, int z) static longoffset(long sectionNode, int stepX, int stepY, int stepZ) static longorigin()static intposToSectionCoord(double pos) relativeToBlockPos(short relative) intrelativeToBlockX(short relative) intrelativeToBlockY(short relative) intrelativeToBlockZ(short relative) static intsectionRelative(int blockCoord) static shortstatic intsectionRelativeX(short relative) static intsectionRelativeY(short relative) static intsectionRelativeZ(short relative) static intsectionToBlockCoord(int sectionCoord) static intsectionToBlockCoord(int sectionCoord, int offset) static longsectionToChunk(long sectionNode) intx()static intx(long sectionNode) inty()static inty(long sectionNode) intz()static intz(long sectionNode) Methods inherited from class Vec3i
above, above, below, below, closerThan, closerToCenterThan, compareTo, cross, distChessboard, distManhattan, distSqr, distToCenterSqr, distToCenterSqr, distToLowCornerSqr, east, east, equals, get, getX, getY, getZ, hashCode, multiply, multiply, north, north, offset, offsetCodec, relative, relative, relative, setX, setY, setZ, south, south, subtract, toMutable, toShortString, toString, west, west
-
Field Details
-
SECTION_BITS
public static final int SECTION_BITS- See Also:
-
SECTION_SIZE
public static final int SECTION_SIZE- See Also:
-
SECTION_MASK
public static final int SECTION_MASK- See Also:
-
SECTION_HALF_SIZE
public static final int SECTION_HALF_SIZE- See Also:
-
SECTION_MAX_INDEX
public static final int SECTION_MAX_INDEX- See Also:
-
PACKED_X_LENGTH
private static final int PACKED_X_LENGTH- See Also:
-
PACKED_Y_LENGTH
private static final int PACKED_Y_LENGTH- See Also:
-
PACKED_Z_LENGTH
private static final int PACKED_Z_LENGTH- See Also:
-
PACKED_X_MASK
private static final long PACKED_X_MASK- See Also:
-
PACKED_Y_MASK
private static final long PACKED_Y_MASK- See Also:
-
PACKED_Z_MASK
private static final long PACKED_Z_MASK- See Also:
-
Y_OFFSET
private static final int Y_OFFSET- See Also:
-
Z_OFFSET
private static final int Z_OFFSET- See Also:
-
X_OFFSET
private static final int X_OFFSET- See Also:
-
RELATIVE_X_SHIFT
private static final int RELATIVE_X_SHIFT- See Also:
-
RELATIVE_Y_SHIFT
private static final int RELATIVE_Y_SHIFT- See Also:
-
RELATIVE_Z_SHIFT
private static final int RELATIVE_Z_SHIFT- See Also:
-
STREAM_CODEC
-
-
Constructor Details
-
SectionPos
private SectionPos(int x, int y, int z)
-
-
Method Details
-
of
-
of
-
of
-
of
-
of
-
of
-
bottomOf
-
offset
-
offset
public static long offset(long sectionNode, int stepX, int stepY, int stepZ) -
posToSectionCoord
public static int posToSectionCoord(double pos) -
blockToSectionCoord
public static int blockToSectionCoord(int blockCoord) -
blockToSectionCoord
public static int blockToSectionCoord(double coord) -
sectionRelative
public static int sectionRelative(int blockCoord) -
sectionRelativePos
-
sectionRelativeX
public static int sectionRelativeX(short relative) -
sectionRelativeY
public static int sectionRelativeY(short relative) -
sectionRelativeZ
public static int sectionRelativeZ(short relative) -
relativeToBlockX
public int relativeToBlockX(short relative) -
relativeToBlockY
public int relativeToBlockY(short relative) -
relativeToBlockZ
public int relativeToBlockZ(short relative) -
relativeToBlockPos
-
sectionToBlockCoord
public static int sectionToBlockCoord(int sectionCoord) -
sectionToBlockCoord
public static int sectionToBlockCoord(int sectionCoord, int offset) -
x
public static int x(long sectionNode) -
y
public static int y(long sectionNode) -
z
public static int z(long sectionNode) -
x
public int x() -
y
public int y() -
z
public int z() -
minBlockX
public int minBlockX() -
minBlockY
public int minBlockY() -
minBlockZ
public int minBlockZ() -
maxBlockX
public int maxBlockX() -
maxBlockY
public int maxBlockY() -
maxBlockZ
public int maxBlockZ() -
blockToSection
public static long blockToSection(long blockNode) -
getZeroNode
public static long getZeroNode(int x, int z) -
getZeroNode
public static long getZeroNode(long sectionNode) -
sectionToChunk
public static long sectionToChunk(long sectionNode) -
origin
-
center
-
chunk
-
asLong
-
asLong
public static long asLong(int x, int y, int z) -
asLong
public long asLong() -
offset
-
blocksInside
-
cube
-
aroundChunk
public static Stream<SectionPos> aroundChunk(ChunkPos center, int radius, int minSection, int maxSection) -
betweenClosedStream
public static Stream<SectionPos> betweenClosedStream(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) -
aroundAndAtBlockPos
public static void aroundAndAtBlockPos(BlockPos blockPos, it.unimi.dsi.fastutil.longs.LongConsumer sectionConsumer) -
aroundAndAtBlockPos
public static void aroundAndAtBlockPos(long blockPos, it.unimi.dsi.fastutil.longs.LongConsumer sectionConsumer) -
aroundAndAtBlockPos
public static void aroundAndAtBlockPos(int blockX, int blockY, int blockZ, it.unimi.dsi.fastutil.longs.LongConsumer sectionConsumer)
-