ChunkWriter class

One chunk's block array, written in world coordinates. Everything outside the chunk is silently skipped, which is the point: a feature (a tree, a village) is drawn whole by every chunk it touches, and each keeps its own part, so the pieces meet at the borders without any chunk seeing another.

Constructors

ChunkWriter(Uint8List blocks, int chunkX, int chunkZ)
A writer over blocks, the volume of chunk (chunkX, chunkZ).

Properties

blocks → Uint8List
The chunk's blocks, ChunkSize.index order.
final
chunkX → int
The chunk's coordinates.
final
chunkZ → int
The chunk's coordinates.
final
hashCode → int
The hash code for this object.
no setterinherited
ox → int
World x and z of the chunk's first column.
final
oz → int
World x and z of the chunk's first column.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

get(int wx, int wy, int wz) → int?
The block at world (wx, wy, wz), or null outside this chunk (or below minY).
levelColumn(int wx, int wz, int ground, int floorY, int clearTo, int fill) → void
Sits a structure's floor on a slope: fills column (wx, wz) with fill from its ground (the first air cell) up to below floorY, and clears it to air from above floorY up to clearTo.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
place(int x, int y, int z, int id, {bool over(int current)?}) → void
Writes id at chunk-local (x, y, z) where the cell is air, where id is air, or where over says the block there gives way (a trunk through a canopy). Outside the chunk, nothing.
put(int wx, int wy, int wz, int id) → void
Writes id at world (wx, wy, wz) when that cell is in this chunk and at or above minY.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

minY → const int
Row 0 is the bedrock floor: put never writes below this.