Skip to content

API reference / @jsprismarine/chunkgen / ChunkStepBuilder

Class: ChunkStepBuilder ​

Defined in: ChunkStep.ts:149

Builds one step the way ChunkPyramid's static initializer does, so the table stays a transcription of the jar rather than a derivation.

Constructors ​

Constructor ​

new ChunkStepBuilder(targetStatus, stepsBelow?): ChunkStepBuilder

Defined in: ChunkStep.ts:158

Parameters ​

targetStatus ​

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

The status the built step produces.

stepsBelow? ​

ReadonlyMap<"empty" | "structure_starts" | "structure_references" | "biomes" | "terrain" | "features" | "initialize_light" | "light" | "spawn" | "full", ChunkStep> = ...

The already-built steps, keyed by their target status. The builder reads the parent's accumulated dependencies out of it, so the pyramid has to build in ladder order.

Returns ​

ChunkStepBuilder

Properties ​

targetStatus ​

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

Defined in: ChunkStep.ts:159

The status the built step produces.

Methods ​

addRequirement() ​

addRequirement(status, radius): this

Defined in: ChunkStep.ts:174

Widens the window to radius rings and requires status through all of them.

Java's ChunkStep.Builder.addRequirement: entries past the current end take status, and entries that already exist take the higher of the two. The parent status seeded at distance 0 takes part in that merge, which is why spawn reads light at distance 0 after being told to require only biomes out to 1.

Parameters ​

status ​

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

radius ​

number

Returns ​

this


build() ​

build(): ChunkStep

Defined in: ChunkStep.ts:192

Closes the direct dependencies over the steps below and returns the finished step.

Returns ​

ChunkStep


setBlockStateWriteRadius() ​

setBlockStateWriteRadius(radius): this

Defined in: ChunkStep.ts:186

Sets how far the step may write blocks. Only terrain (0) and features (1) set it.

Parameters ​

radius ​

number

Returns ​

this