Interface Chunk
- All Superinterfaces:
SchedulerSource
A loaded 16x16 column of a
World.
Block coordinates taken by this interface are local on the X and Z axes (0 to
15) and absolute on the Y axis. Tasks scheduled through SchedulerSource run on
the region thread owning this chunk.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionintblockLight(int localX, int worldY, int localZ) Returns the block light level at a position of this chunk, between0and15.intblockStateId(int localX, int worldY, int localZ) Gets the block state at a position of this chunk.intchunkX()Returns the chunk X coordinate.intchunkZ()Returns the chunk Z coordinate.intheight()Returns the number of block layers of this chunk, starting atminY().default booleanWhether this chunk is force-loaded.intlightLevel(int localX, int worldY, int localZ) Returns the effective light level at a position of this chunk, the highest of block and sky light.intminY()Returns the lowest block Y coordinate of this chunk, inclusive.default ChunkPospos()Returns the position of this chunk.setBlockStateId(int localX, int worldY, int localZ, int stateId) Replaces the block state at a position of this chunk, on the region thread owning it.intskyLight(int localX, int worldY, int localZ) Returns the sky light level at a position of this chunk, between0and15.world()Returns the world this chunk belongs to.Methods inherited from interface SchedulerSource
execute, executeDelayed, isOwnedByCurrentThread
-
Method Details
-
world
World world()Returns the world this chunk belongs to.- Returns:
- the world this chunk belongs to
- Since:
- 0.1.0
-
chunkX
int chunkX()Returns the chunk X coordinate.- Returns:
- the chunk X coordinate
- Since:
- 0.1.0
-
chunkZ
int chunkZ()Returns the chunk Z coordinate.- Returns:
- the chunk Z coordinate
- Since:
- 0.1.0
-
pos
Returns the position of this chunk.- Returns:
- the position of this chunk
- Since:
- 0.1.0
-
isForceLoaded
default boolean isForceLoaded()Whether this chunk is force-loaded.- Returns:
trueif this chunk is force-loaded- Since:
- 0.1.0
- See Also:
-
minY
int minY()Returns the lowest block Y coordinate of this chunk, inclusive.- Returns:
- the lowest block Y coordinate of this chunk, inclusive
- Since:
- 0.1.0
-
height
-
blockStateId
int blockStateId(int localX, int worldY, int localZ) Gets the block state at a position of this chunk.- Parameters:
localX- the X coordinate inside the chunk,0to15worldY- the absolute Y coordinatelocalZ- the Z coordinate inside the chunk,0to15- Returns:
- the network identifier of the block state
- Since:
- 0.1.0
-
setBlockStateId
Replaces the block state at a position of this chunk, on the region thread owning it.- Parameters:
localX- the X coordinate inside the chunk,0to15worldY- the absolute Y coordinatelocalZ- the Z coordinate inside the chunk,0to15stateId- the network identifier of the new block state- Returns:
- a future completing with
trueif the block changed - Since:
- 0.1.0
-
blockLight
int blockLight(int localX, int worldY, int localZ) Returns the block light level at a position of this chunk, between0and15.- Parameters:
localX- the X coordinate inside the chunkworldY- the absolute Y coordinatelocalZ- the Z coordinate inside the chunk- Returns:
- the block light level at a position of this chunk, between
0and15 - Since:
- 0.1.0
-
skyLight
int skyLight(int localX, int worldY, int localZ) Returns the sky light level at a position of this chunk, between0and15.- Parameters:
localX- the X coordinate inside the chunkworldY- the absolute Y coordinatelocalZ- the Z coordinate inside the chunk- Returns:
- the sky light level at a position of this chunk, between
0and15 - Since:
- 0.1.0
-
lightLevel
int lightLevel(int localX, int worldY, int localZ) Returns the effective light level at a position of this chunk, the highest of block and sky light.- Parameters:
localX- the X coordinate inside the chunkworldY- the absolute Y coordinatelocalZ- the Z coordinate inside the chunk- Returns:
- the effective light level at a position of this chunk, the highest of block and sky light
- Since:
- 0.1.0
-