Creates an empty world with the given generation seed.
master seed for terrain, biome, and erosion noise
ReadonlyblockPer-block state (container contents, machine progress, …).
ReadonlyscheduledMin-heap of scheduled block ticks, drained in game-tick order.
Monotonic game-tick counter advanced by update.
Discrete game ticks per second (Minecraft-style 20).
Random ticks per resident chunk per game tick (crops/grass/etc.).
Chunk radius around the player that receives random ticks.
OptionalonOptionalonOptionalonOptionalonFires after any block is placed via setBlockType. World-space coords.
OptionalonFires before a block is removed via mineBlock. World-space coords.
Hard cap on the number of resident chunks, derived from the current view
range so a larger renderDistanceH/renderDistanceV raises the budget and
a smaller one frees memory. Sized for the cylindrical load volume (circular
footprint × vertical span) using the +1 removal hysteresis radius, plus a
margin so the steady-state set never bumps the cap and stalls loading.
Number of chunks currently resident in memory.
Iterator over all resident chunks.
Returns the biome at a world-space block position (does not require the chunk to exist).
world X
world Y
world Z
StaticnormalizeConverts a world-space block position to integer chunk coordinates.
world X
world Y
world Z
[cx, cy, cz] chunk coordinates
Returns the chunk containing the given world-space block position, or undefined if not loaded.
world X
world Y
world Z
Returns true if a chunk exists at the given world-space block position.
world X
world Y
world Z
Returns the block type at a world-space position, or BlockType.NONE if the chunk is not loaded.
world X
world Y
world Z
Sets the block at a world-space position, creating the chunk if needed and re-meshing it.
world X
world Y
world Z
new block type
true on success
Returns the Y of the first air block above the highest solid/water block in column (wx, wz).
Scans downward from maxY. Returns 0 if the column is empty.
world X
world Z
upper bound to start scanning from
Like getTopBlockY, but skips water (and props) so it returns the Y of the first air block above the highest solid (walkable) block. Use this to distinguish dry land from ocean: a column whose top solid surface sits below Chunk.SEA_LEVEL is submerged.
Returns 0 if the column has no solid block.
Casts a ray through the voxel grid and returns the first non-water block hit.
Implements the Amanatides & Woo "Fast Voxel Traversal Algorithm for Ray Tracing". Water blocks are skipped (the ray passes through them).
hit description, or null if no block was hit
Places a block adjacent to the hit block on the given face.
The new block goes at (gX + faceX, gY + faceY, gZ + faceZ). Existing
non-air, non-water blocks block placement. Creates the target chunk if needed.
hit block world X
hit block world Y
hit block world Z
face normal X
face normal Y
face normal Z
block type to place
true if a block was placed
Removes the block at the given world position and re-meshes the affected chunk(s).
world X
world Y
world Z
true if a block was removed
Advances world time, streams chunks around the player, and ticks water flow.
current player position
elapsed time in seconds
Advances one discrete game tick: dispatches all scheduled ticks now due, then a random-tick sweep of chunks near the player. Exposed for tests / deterministic stepping; update calls it at tickRate.
OptionalplayerPos: Vec3center for the random-tick sweep (omit to skip random ticks)
Schedules a tick for the block at (wx,wy,wz) delayTicks ticks from now.
Returns the block-entity state at a world position, if any.
Stores block-entity state at a world position.
Removes block-entity state at a world position.
Notifies the 6 face-adjacent blocks that the block at (wx,wy,wz) changed, dispatching each neighbor's registered handler. Handlers that themselves change blocks cascade through this; a depth guard caps runaway chains (handlers that would propagate far should schedule a tick instead).
Removes a chunk from the world, marks it deleted, and notifies listeners.
chunk to delete
Computes a discrete water depth value at the given world position.
Walks upward through stacked chunks of water and accumulates a per-chunk level contribution based on the height of the water column.
world X
world Y
world Z
aggregate water level (0 if not in water)
Returns the cached hydraulic-erosion displacement at world XZ.
Looks up (and lazily generates) the 128x128 region containing (gx, gz).
world X
world Z
Streaming voxel world built from
Chunks keyed by integer chunk coordinates.Chunks are stored in a
Map<string, Chunk>keyed by"cx,cy,cz", where chunk coordinates are world coords floor-divided by chunk dimensions.update()generates chunks withinrenderDistanceH/renderDistanceVof the player and removes ones outside that radius. New chunks are created at mostchunksPerFrameper call, sorted by distance to the player. Generation uses a cached 128x128 hydraulic erosion displacement field per region.