Interface ChunkVolume
-
- All Superinterfaces:
Volume
- All Known Subinterfaces:
ClientWorld,GenerationRegion,Region<R>,ServerWorld,World<W,L>,WorldLike<P>
public interface ChunkVolume extends Volume
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Chunk<?>chunk(int x, int y, int z)Gets the loaded chunk at the given chunk coordinate position.default Chunk<?>chunk(Vector3i chunkPosition)Gets the loaded chunk at the given chunk coordinate position.Chunk<?>chunkAtBlock(int bx, int by, int bz)Gets the loaded chunk at the given chunk coordinate position.default Chunk<?>chunkAtBlock(Vector3i blockPosition)Gets the loaded chunk at the given block coordinate position.ChunkLayoutchunkLayout()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 booleanhasChunk(Vector3i chunkPosition)Gets 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 Detail
-
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
Chunk<?> chunk(int x, int y, int z)
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
default Chunk<?> chunk(Vector3i chunkPosition)
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
default Chunk<?> chunkAtBlock(Vector3i blockPosition)
Gets the loaded chunk at the given block coordinate position.- Parameters:
blockPosition- The position- Returns:
- The chunk, if available
-
chunkAtBlock
Chunk<?> chunkAtBlock(int bx, int by, int bz)
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
default boolean isChunkLoaded(Vector3i chunkPosition, 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:
chunkPosition- The chunk coordinatesallowEmpty- Whether to allow empty chunks- Returns:
- Whether a chunk is loaded or not
-
isChunkLoadedAtBlock
default boolean isChunkLoadedAtBlock(Vector3i position, 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:
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
default boolean hasChunk(Vector3i chunkPosition)
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
default boolean hasChunkAtBlock(Vector3i blockPosition)
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
-
-