Chunk

Classic chunk with the size of 16 * 16.

Constructors

this
this(World world, ChunkPosition position, string location)
Undocumented in source.

Members

Functions

createSection
Section* createSection(size_t y)
Undocumented in source. Be warned that the author may not have intended to support it.
emptySection
bool emptySection(size_t y)

Checks whether or not a section is empty (has no blocks in it).

firstBlock
ptrdiff_t firstBlock(ubyte x, ubyte z)

Gets the y position of the first non-air block from top.

opBinaryRight
Section* opBinaryRight(size_t y)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
Block* opIndex(BlockPosition position)
Block* opIndex(ubyte x, size_t y, ubyte z)

Gets a block in the chunk.

opIndex
Section opIndex(size_t y)

Gets a section.

opIndexAssign
Block* opIndexAssign(Block* block, BlockPosition position)
Block* opIndexAssign(block_t block, BlockPosition position)
Block* opIndexAssign(Block* block, ubyte x, uint y, ubyte z)
Block* opIndexAssign(block_t block, ubyte x, uint y, ubyte z)

Sets a block in the chunk.

registerTile
void registerTile(T tile)

Registers a tile.

removeSection
void removeSection(size_t y)
Undocumented in source. Be warned that the author may not have intended to support it.
resetSnow
void resetSnow()

Resets the snow

save
void save()
Undocumented in source. Be warned that the author may not have intended to support it.
sectionAt
Section sectionAt(size_t y)

Gets a section.

tickSection
bool tickSection(size_t y)

Checks if a section contains blocks with the random tick.

tileAt
T tileAt(BlockPosition position)

Gets a tile.

unload
void unload()

Unloads a chunks and frees its memory

Properties

blocks
BlockStorage blocks [@property getter]

Gets the world's blocks

empty
bool empty [@property getter]

Checks whether or not the chunks is air.

nextSnow
Vector2!ubyte nextSnow [@property getter]

Gets or generate the position for the next block where the snow should fall.

position
ChunkPosition position [@property getter]

Returns the position of the chunk in the world.

sections
Section[size_t] sections [@property getter]

Gets the sections.

world
World world [@property getter]

Gets the chunk's world.

x
int x [@property getter]
z
int z [@property getter]

Returns the position of the chunk in the world.

Variables

HEIGHT
enum uint HEIGHT;
Undocumented in source.
biomes
const(Biome)[16 * 16] biomes;
Undocumented in source.
changed_blocks
BlockPosition[] changed_blocks;
Undocumented in source.
changed_tiles
Tile[uint] changed_tiles;
Undocumented in source.
lights
ubyte[16 * 16 * 2] lights;
Undocumented in source.
location
string location;
Undocumented in source.
saveChangedBlocks
bool saveChangedBlocks;
Undocumented in source.
tiles
Tile[ushort] tiles;
Undocumented in source.

Meta