Interface ChunkVolume
- All Superinterfaces:
Volume
- All Known Subinterfaces:
ClientWorld
,GenerationRegion
,Region<R>
,ServerWorld
,World<W,
,L> WorldLike<P>
-
Method Summary
Modifier and TypeMethodDescriptionchunk
(int x, int y, int z) Gets the loaded chunk at the given chunk coordinate position.Gets the loaded chunk at the given chunk coordinate position.chunkAtBlock
(int bx, int by, int bz) Gets the loaded chunk at the given chunk coordinate position.chunkAtBlock
(Vector3i blockPosition) Gets the loaded chunk at the given block coordinate position.Returns information about the chunk layout used by this volume's implementation.boolean
hasChunk
(int cx, int cy, int cz) Gets whether aChunk
exists at the particular chunk coordinates.default boolean
Gets whether aChunk
exists at the particular block coordinates.default boolean
hasChunkAtBlock
(int bx, int by, int bz) Gets whether aChunk
exists at the particular block coordinates.default boolean
hasChunkAtBlock
(Vector3i blockPosition) Gets whether aChunk
exists at the particular block coordinates.boolean
isChunkLoaded
(int cx, int cy, int cz, boolean allowEmpty) Gets whether aChunk
is loaded at the particular chunk coordinates.default boolean
isChunkLoaded
(Vector3i chunkPosition, boolean allowEmpty) Gets whether aChunk
is loaded at the particular chunk coordinates.default boolean
isChunkLoadedAtBlock
(int bx, int by, int bz, boolean allowEmpty) Gets whether aChunk
is loaded at the particular block coordinates.default boolean
isChunkLoadedAtBlock
(Vector3i position, boolean allowEmpty) Gets whether aChunk
is loaded at the particular block coordinates.
-
Method Details
-
chunkLayout
ChunkLayout chunkLayout()Returns information about the chunk layout used by this volume's implementation. May differ based on theServer.chunkLayout()
used on the server.- Returns:
- The chunk layout used by the implementation
-
chunk
Gets the loaded chunk at the given chunk coordinate position. The position is the same asChunk.chunkPosition()
. The difference between a block placed within aWorldLike
is different from aChunk
's position, and therefore care should be taken when requesting a chunk. It is not guaranteed that the returnedChunk
isempty
or not, nor thestate
of the chunk.In Vanilla, the y coordinate will always be 0.
- Parameters:
x
- The x coordinatey
- The y coordinatez
- The z coordinate- Returns:
- The chunk, may be empty
-
chunk
Gets the loaded chunk at the given chunk coordinate position. The position is the same asChunk.chunkPosition()
. The difference between a block placed within aWorldLike
is different from aChunk
's position, and therefore care should be taken when requesting a chunk. It is not guaranteed that the returnedChunk
isempty
or not, nor thestate
of the chunk.- Parameters:
chunkPosition
- The position- Returns:
- The chunk, if available
-
chunkAtBlock
Gets the loaded chunk at the given block coordinate position.- Parameters:
blockPosition
- The position- Returns:
- The chunk, if available
-
chunkAtBlock
Gets the loaded chunk at the given chunk coordinate position. The position is the block position relative to theChunk.chunkPosition()
, and therefor is going to return a different chunk fromchunk(Vector3i)
. This is more usable fromServerLocation
s or aLocatable
that returns aposition
in relation to aWorldLike
.- Parameters:
bx
- The x coordinateby
- The y coordinatebz
- The z coordinate- Returns:
- The chunk, if available
-
isChunkLoaded
boolean isChunkLoaded(int cx, int cy, int cz, boolean allowEmpty) Gets whether aChunk
is loaded at the particular chunk coordinates. Note that chunk coordinates are distinctly different from block coordinates, refer to thechunkLayout()
to convert back and forth.- Parameters:
cx
- The chunk x coordinatecy
- The chunk y coordinatecz
- The chunk z coordinateallowEmpty
- Whether to allow empty chunks- Returns:
- Whether a chunk is loaded or not
-
isChunkLoadedAtBlock
default boolean isChunkLoadedAtBlock(int bx, int by, int bz, boolean allowEmpty) Gets whether aChunk
is loaded at the particular block coordinates. Note that chunk coordinates are distinctly different from block coordinates, refer to thechunkLayout()
to convert back and forth.- Parameters:
bx
- The block x coordinateby
- The block y coordinatebz
- The block z coordinateallowEmpty
- Whether to allow empty chunks- Returns:
- Whether a chunk is loaded or not
-
isChunkLoaded
Gets whether aChunk
is loaded at the particular chunk coordinates. Note that chunk coordinates are distinctly different from block coordinates, refer to thechunkLayout()
to convert back and forth.- Parameters:
chunkPosition
- The chunk coordinatesallowEmpty
- Whether to allow empty chunks- Returns:
- Whether a chunk is loaded or not
-
isChunkLoadedAtBlock
Gets whether aChunk
is loaded at the particular block coordinates. Note that chunk coordinates are distinctly different from block coordinates, refer to thechunkLayout()
to convert back and forth.- Parameters:
position
- The block coordinatesallowEmpty
- Whether to allow empty chunks- Returns:
- Whether a chunk is loaded or not
-
hasChunk
boolean hasChunk(int cx, int cy, int cz) Gets whether aChunk
exists at the particular chunk coordinates. Note that chunk coordinates are distinctly different from block coordinates, refer to thechunkLayout()
to convert back and forth.- Parameters:
cx
- The chunk x coordinatecy
- The chunk y coordinatecz
- The chunk z coordinate- Returns:
- Whether a chunk exists
-
hasChunkAtBlock
default boolean hasChunkAtBlock(int bx, int by, int bz) Gets whether aChunk
exists at the particular block coordinates. Note that chunk coordinates are distinctly different from block coordinates, refer to thechunkLayout()
to convert back and forth.- Parameters:
bx
- The block x coordinateby
- The block y coordinatebz
- The block z coordinate- Returns:
- Whether a chunk exists
-
hasChunk
Gets whether aChunk
exists at the particular block coordinates. Note that chunk coordinates are distinctly different from block coordinates, refer to thechunkLayout()
to convert back and forth.- Parameters:
chunkPosition
- The chunk coordinates- Returns:
- Whether a chunk exists
-
hasChunkAtBlock
Gets whether aChunk
exists at the particular block coordinates. Note that chunk coordinates are distinctly different from block coordinates, refer to thechunkLayout()
to convert back and forth.- Parameters:
blockPosition
- The block coordinates- Returns:
- Whether a chunk exists
-