Skip to content

API reference / @jsprismarine/chunkgen / ChunkPyramid

Class: ChunkPyramid ​

Defined in: ChunkPyramid.ts:47

A step per status, built in ladder order so each one can close over the windows below it.

Java has two of these. This is GENERATION_PYRAMID, the one that applies when a chunk has to be generated. LOADING_PYRAMID, which applies when every chunk in range is already persisted deep enough to read from disk, is not reproduced here.

Constructors ​

Constructor ​

new ChunkPyramid(declarations): ChunkPyramid

Defined in: ChunkPyramid.ts:51

Parameters ​

declarations ​

Readonly<Record<ChunkStatus, StepDeclaration>>

One declaration per status, applied in CHUNK_STATUSES order.

Returns ​

ChunkPyramid

Methods ​

radiusOf() ​

radiusOf(status, target?): number

Defined in: ChunkPyramid.ts:76

How far a status must have spread around a chunk before that chunk can reach target.

This is the number the parallel design turns on. For a full target it reads 11 for empty and structure_starts, 3 for structure_references and biomes, 2 for terrain, 1 for features and initialize_light, and 0 for light and spawn.

Parameters ​

status ​

"empty" | "structure_starts" | "structure_references" | "biomes" | "terrain" | "features" | "initialize_light" | "light" | "spawn" | "full"

target? ​

"empty" | "structure_starts" | "structure_references" | "biomes" | "terrain" | "features" | "initialize_light" | "light" | "spawn" | "full" = 'full'

Returns ​

number

The radius in chunks, or -1 when the target does not depend on that status at all.


stepTo() ​

stepTo(status): ChunkStep

Defined in: ChunkPyramid.ts:60

The step that takes a chunk from the status below up to this one.

Parameters ​

status ​

"empty" | "structure_starts" | "structure_references" | "biomes" | "terrain" | "features" | "initialize_light" | "light" | "spawn" | "full"

Returns ​

ChunkStep