public class ChunkSectionPos extends Vec3i
Modifier | Constructor and Description |
---|---|
private |
ChunkSectionPos(int x,
int y,
int z) |
Modifier and Type | Method and Description |
---|---|
long |
asLong() |
static long |
asLong(int x,
int y,
int z) |
static ChunkSectionPos |
from(BlockPos pos) |
static ChunkSectionPos |
from(ChunkPos chunkPos,
int y)
Creates a chunk section position from a chunk position and the y-coordinate of the vertical section.
|
static ChunkSectionPos |
from(Entity entity) |
static ChunkSectionPos |
from(int x,
int y,
int z)
Creates a chunk section position from its x-, y- and z-coordinates.
|
static ChunkSectionPos |
from(long packed)
Creates a chunk section position from its packed representation.
|
static long |
fromBlockPos(long blockPos)
Gets the packed chunk section coordinate for a given packed
BlockPos . |
static int |
getBlockCoord(int sectionCoord)
Converts the given chunk section coordinate to the world coordinate system.
|
BlockPos |
getCenterPos() |
static int |
getLocalCoord(int coord)
Converts a world coordinate to the local coordinate system (0-15) of its corresponding chunk section.
|
int |
getMaxX() |
int |
getMaxY() |
int |
getMaxZ() |
BlockPos |
getMinPos() |
int |
getMinX() |
int |
getMinY() |
int |
getMinZ() |
static int |
getSectionCoord(int coord)
Converts a world coordinate to the corresponding chunk-section coordinate.
|
int |
getSectionX() |
int |
getSectionY() |
int |
getSectionZ() |
static long |
offset(long packed,
Direction direction)
Offsets a packed chunk section position in the given direction.
|
static long |
offset(long packed,
int x,
int y,
int z)
Offsets a packed chunk section position by the given offsets.
|
static short |
packLocal(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(ChunkPos center,
int radius) |
static Stream<ChunkSectionPos> |
stream(ChunkSectionPos center,
int radius) |
static Stream<ChunkSectionPos> |
stream(int minX,
int minY,
int minZ,
int maxX,
int maxY,
int maxZ) |
Stream<BlockPos> |
streamBlocks() |
ChunkPos |
toChunkPos() |
BlockPos |
unpackBlockPos(short packedLocalPos)
Gets the world position of the given local position within this chunk section.
|
int |
unpackBlockX(short packedLocalPos)
Gets the world x-coordinate of the given local position within this chunk section.
|
int |
unpackBlockY(short packedLocalPos)
Gets the world y-coordinate of the given local position within this chunk section.
|
int |
unpackBlockZ(short packedLocalPos)
Gets the world z-coordinate of the given local position within this chunk section.
|
static int |
unpackLocalX(short packedLocalPos)
Gets the local x-coordinate from the given packed local position.
|
static int |
unpackLocalY(short packedLocalPos)
Gets the local y-coordinate from the given packed local position.
|
static int |
unpackLocalZ(short packedLocalPos)
Gets the local z-coordinate from the given packed local position.
|
static int |
unpackX(long packed)
Gets the chunk section x-coordinate from the given packed chunk section coordinate.
|
static int |
unpackY(long packed)
Gets the chunk section y-coordinate from the given packed chunk section coordinate.
|
static int |
unpackZ(long packed)
Gets the chunk section z-coordinate from the given packed chunk section coordinate.
|
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.
|
compareTo, crossProduct, down, down, equals, getComponentAlongAxis, getManhattanDistance, getSquaredDistance, getSquaredDistance, getSquaredDistance, getX, getY, getZ, hashCode, isWithinDistance, isWithinDistance, offset, setX, setY, setZ, toShortString, toString, up, up
public static ChunkSectionPos from(int x, int y, int z)
public static ChunkSectionPos from(BlockPos pos)
public static ChunkSectionPos from(ChunkPos chunkPos, int y)
public static ChunkSectionPos from(Entity entity)
public static ChunkSectionPos from(long packed)
asLong(int, int, int)
public static long offset(long packed, Direction direction)
asLong(int, int, int)
public static long offset(long packed, int x, int y, int z)
asLong(int, int, int)
public static int getSectionCoord(int coord)
public static int getLocalCoord(int coord)
public static short packLocal(BlockPos pos)
public static int unpackLocalX(short packedLocalPos)
public static int unpackLocalY(short packedLocalPos)
public static int unpackLocalZ(short packedLocalPos)
public int unpackBlockX(short packedLocalPos)
public int unpackBlockY(short packedLocalPos)
public int unpackBlockZ(short packedLocalPos)
public BlockPos unpackBlockPos(short packedLocalPos)
public static int getBlockCoord(int sectionCoord)
public static int unpackX(long packed)
asLong(int, int, int)
public static int unpackY(long packed)
asLong(int, int, int)
public static int unpackZ(long packed)
asLong(int, int, int)
public int getSectionX()
public int getSectionY()
public int getSectionZ()
public int getMinX()
public int getMinY()
public int getMinZ()
public int getMaxX()
public int getMaxY()
public int getMaxZ()
public static long fromBlockPos(long blockPos)
BlockPos
.asLong(int, int, int)
,
BlockPos.asLong()
public static long withZeroY(long pos)
asLong(int, int, int)
public BlockPos getMinPos()
public BlockPos getCenterPos()
public ChunkPos toChunkPos()
public static long asLong(int x, int y, int z)
public long asLong()
public static Stream<ChunkSectionPos> stream(ChunkSectionPos center, int radius)
public static Stream<ChunkSectionPos> stream(ChunkPos center, int radius)
public static Stream<ChunkSectionPos> stream(int minX, int minY, int minZ, int maxX, int maxY, int maxZ)