Creates an empty chunk anchored at the given world-space min corner.
world X of the chunk min corner
world Y of the chunk min corner
world Z of the chunk min corner
StaticCHUNK_Chunk size in blocks along the X axis.
StaticCHUNK_Chunk size in blocks along the vertical Y axis.
StaticCHUNK_Chunk size in blocks along the Z axis.
StaticSEA_Global Y level at which oceans and lakes are filled with water.
StaticOCEAN_Depth (in blocks below SEA_LEVEL) of the floor of a fully-deep
ocean basin. The seabed lands near SEA_LEVEL - OCEAN_DEPTH (plus a few
blocks of relief), so the default puts the deepest seabed around y = -15.
Static ReadonlyCUBE_Unit-cube vertex positions for 6 faces × 6 verts = 36 verts, ordered back/front/left/right/bottom/top.
Builds opaque, semi-transparent, water, and prop vertex buffers for the chunk.
Uses greedy meshing across X/Y/Z for cube faces and a padded copy of the block grid
(with one layer of neighbor data) so boundary checks have no per-axis branching in
the hot loop. Vertex layout is [x, y, z, normal(0-5 or 6 for billboard), blockType].
Optionalneighbors: ChunkNeighborsoptional block arrays of the six neighbor chunks for face culling
the populated ChunkMesh
Populates the chunk's blocks via 3D Perlin terrain, biome selection, caves, and a second pass that places trees and props.
world seed driving all noise
OptionalgetErosion: (gx: number, gz: number) => numberoptional per-column hydraulic erosion displacement sampler
Static_Continentalness in [0, 1] for a world column: 0 = dry land, 1 = deep
ocean, with a smooth continental-shelf ramp between the coast and the
deep-water threshold. Driven by a single low-frequency noise so oceans
form large coherent basins rather than scattered ponds.
world X
world Z
world seed
Static_Sets the block at local coordinates and updates per-category counts.
Out-of-bounds coordinates are silently ignored.
local X in [0, CHUNK_WIDTH)
local Y in [0, CHUNK_HEIGHT)
local Z in [0, CHUNK_DEPTH)
new block type
Returns the block at local coordinates, or BlockType.NONE if out of bounds.
local X
local Y
local Z
Returns the flat index into blocks for local coordinates, or -1 if out of bounds.
local X
local Y
local Z
Static_Static_Static_Static_Static_Static_Static_Static_Ore distribution within underground stone. Each ore is an independent 3D
noise field; the block becomes ore where that field exceeds a threshold and
the column is at least minDepth blocks below the surface. Smaller scale
and higher threshold yield smaller, rarer veins. Ores are tested rarest
first so a deep-and-rich noise hit wins over a common one when veins overlap.
world X of the stone block
world Y of the stone block
world Z of the stone block
world seed
blocks between this position and the surface
the ore BlockType, or NONE to leave plain stone
A 16x16x16 cube of blocks with axis convention X = width, Y = height (vertical), Z = depth.
Owns the raw block array, tracks per-category block counts, and generates both terrain (
generateBlocks) and renderable vertex meshes (generateVertices). Chunks are positioned in world space byglobalPosition, which is the min-corner of the chunk.