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.booleanhasChunk(int cx, int cy, int cz) Gets whether aChunkexists at the particular chunk coordinates.default booleanGets whether aChunkexists at the particular block coordinates.default booleanhasChunkAtBlock(int bx, int by, int bz) Gets whether aChunkexists at the particular block coordinates.default booleanhasChunkAtBlock(Vector3i blockPosition) Gets whether aChunkexists at the particular block coordinates.booleanisChunkLoaded(int cx, int cy, int cz, boolean allowEmpty) Gets whether aChunkis loaded at the particular chunk coordinates.default booleanisChunkLoaded(Vector3i chunkPosition, boolean allowEmpty) Gets whether aChunkis loaded at the particular chunk coordinates.default booleanisChunkLoadedAtBlock(int bx, int by, int bz, boolean allowEmpty) Gets whether aChunkis loaded at the particular block coordinates.default booleanisChunkLoadedAtBlock(Vector3i position, boolean allowEmpty) Gets whether aChunkis 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 aWorldLikeis different from aChunk's position, and therefore care should be taken when requesting a chunk. It is not guaranteed that the returnedChunkisemptyor not, nor thestateof 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 aWorldLikeis different from aChunk's position, and therefore care should be taken when requesting a chunk. It is not guaranteed that the returnedChunkisemptyor not, nor thestateof 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 fromServerLocations or aLocatablethat returns apositionin 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 aChunkis 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 aChunkis 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 aChunkis 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 aChunkis 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 aChunkexists 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 aChunkexists 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 aChunkexists 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 aChunkexists 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
-