The cChunkDesc class is a container for chunk data while the chunk is being generated. As such, it is
only used as a parameter for the OnChunkGenerating and
OnChunkGenerated hooks and cannot be constructed on its own. Plugins can use this
class in both those hooks to manipulate generated chunks.
Calls to any setter of this class will not trigger simulator updates (lava, water, redstone).
Name | Parameters | Return value | Notes |
FillBlocks |
BlockType | number | BlockMeta | number |
|
|
Fills the entire chunk with the specified blocks |
FillRelCuboid |
RelCuboid | cCuboid | BlockType | number | BlockMeta | number |
|
|
Fills the cuboid, specified in relative coords, by the specified block type and block meta. The cuboid may reach outside of the chunk, only the part intersecting with this chunk is filled. |
FillRelCuboid |
MinRelX | number | MaxRelX | number | MinRelY | number | MaxRelY | number | MinRelZ | number | MaxRelZ | number | BlockType | number | BlockMeta | number |
|
|
Fills the cuboid, specified in relative coords, by the specified block type and block meta. The cuboid may reach outside of the chunk, only the part intersecting with this chunk is filled. |
FloorRelCuboid |
RelCuboid | cCuboid | BlockType | number | BlockMeta | number |
|
|
Fills those blocks of the cuboid (specified in relative coords) that are considered non-floor (air, water) with the specified block type and meta. Cuboid may reach outside the chunk, only the part intersecting with this chunk is filled. |
FloorRelCuboid |
MinRelX | number | MaxRelX | number | MinRelY | number | MaxRelY | number | MinRelZ | number | MaxRelZ | number | BlockType | number | BlockMeta | number |
|
|
Fills those blocks of the cuboid (specified in relative coords) that are considered non-floor (air, water) with the specified block type and meta. Cuboid may reach outside the chunk, only the part intersecting with this chunk is filled. |
GetBiome |
|
|
Returns the biome at the specified relative coords |
GetBlockEntity |
RelX | number | RelY | number | RelZ | number |
|
|
Returns the block entity for the block at the specified coords. Creates it if it doesn't exist. Returns nil if the block has no block entity capability. |
GetBlockMeta |
RelX | number | RelY | number | RelZ | number |
|
|
Returns the block meta at the specified relative coords |
GetBlockType |
RelX | number | RelY | number | RelZ | number |
|
|
Returns the block type at the specified relative coords |
GetBlockTypeMeta |
RelX | number | RelY | number | RelZ | number |
|
BLOCKTYPE | number | NIBBLETYPE | number |
|
Returns the block type and meta at the specified relative coords |
GetChunkX |
|
|
Returns the X coord of the chunk contained. |
GetChunkZ |
|
|
Returns the Z coord of the chunk contained. |
GetHeight |
|
|
Returns the height at the specified relative coords |
GetMaxHeight |
|
|
Returns the maximum height contained in the heightmap. |
GetMinHeight |
|
|
Returns the minimum height value in the heightmap. |
IsUsingDefaultBiomes |
|
|
Returns true if the chunk is set to use default biome generator |
IsUsingDefaultComposition |
|
|
Returns true if the chunk is set to use default composition generator |
IsUsingDefaultFinish |
|
|
Returns true if the chunk is set to use default finishers |
IsUsingDefaultHeight |
|
|
Returns true if the chunk is set to use default height generator |
RandomFillRelCuboid |
RelCuboid | cCuboid | BlockType | number | BlockMeta | number | RandomSeed | number | ChanceOutOf10k | number |
|
|
Fills the specified relative cuboid with block type and meta in random locations. RandomSeed is used for the random number genertion (same seed produces same results); ChanceOutOf10k specifies the density (how many out of every 10000 blocks should be filled). Cuboid may reach outside the chunk, only the part intersecting with this chunk is filled. |
RandomFillRelCuboid |
MinRelX | number | ChanceOutOf10k | number | MaxRelX | number | MinRelY | number | MaxRelY | number | MinRelZ | number | MaxRelZ | number | BlockType | number | BlockMeta | number | RandomSeed | number |
|
|
Fills the specified relative cuboid with block type and meta in random locations. RandomSeed is used for the random number genertion (same seed produces same results); ChanceOutOf10k specifies the density (how many out of every 10000 blocks should be filled). Cuboid may reach outside the chunk, only the part intersecting with this chunk is filled. |
ReadBlockArea |
BlockArea | cBlockArea | MinRelX | number | MaxRelX | number | MinRelY | number | MaxRelY | number | MinRelZ | number | MaxRelZ | number |
|
|
Reads data from the chunk into the block area object. Block types and metas are processed. |
ReplaceRelCuboid |
RelCuboid | cCuboid | SrcBlockType | number | SrcBlockMeta | number | DstBlockType | number | DstBlockMeta | number |
|
|
Replaces all SrcBlockType + SrcBlockMeta blocks in the cuboid (specified in relative coords) with DstBlockType + DstBlockMeta blocks. Cuboid may reach outside the chunk, only the part intersecting with this chunk is filled. |
ReplaceRelCuboid |
MinRelX | number | MaxRelX | number | MinRelY | number | MaxRelY | number | MinRelZ | number | MaxRelZ | number | SrcBlockType | number | SrcBlockMeta | number | DstBlockType | number | DstBlockMeta | number |
|
|
Replaces all SrcBlockType + SrcBlockMeta blocks in the cuboid (specified in relative coords) with DstBlockType + DstBlockMeta blocks. Cuboid may reach outside the chunk, only the part intersecting with this chunk is filled. |
SetBiome |
|
|
Sets the biome at the specified relative coords. |
SetBlockMeta |
RelX | number | RelY | number | RelZ | number | BlockMeta | number |
|
|
Sets the block meta at the specified relative coords. |
SetBlockType |
RelX | number | RelY | number | RelZ | number | BlockType | number |
|
|
Sets the block type at the specified relative coords |
SetBlockTypeMeta |
RelX | number | RelY | number | RelZ | number | BlockType | number | BlockMeta | number |
|
|
Sets the block type and meta at the specified relative coords |
SetHeight |
RelX | number | RelZ | number | Height | number |
|
|
Sets the height at the specified relative coords |
SetUseDefaultBiomes |
ShouldUseDefaultBiomes | boolean |
|
|
Sets the chunk to use default biome generator or not |
SetUseDefaultComposition |
ShouldUseDefaultComposition | boolean |
|
|
Sets the chunk to use default composition generator or not |
SetUseDefaultFinish |
ShouldUseDefaultFinish | boolean |
|
|
Sets the chunk to use default finishers or not |
SetUseDefaultHeight |
ShouldUseDefaultHeight | boolean |
|
|
Sets the chunk to use default height generator or not |
UpdateHeightmap |
|
|
Updates the heightmap to match current contents. The plugins should do that if they modify the contents and don't modify the heightmap accordingly; Cuberite expects (and checks in Debug mode) that the heightmap matches the contents when the cChunkDesc is returned from a plugin. |
WriteBlockArea |
|
|
Writes data from the block area into the chunk |
The following code is taken from the Debuggers plugin, it creates a sign at each chunk's [0, 0]
coords, with the text being the chunk coords: