API reference / @jsprismarine/chunkgen / ChunkDependencies
Class: ChunkDependencies
Defined in: ChunkStep.ts:12
The status each neighbor is guaranteed to have reached, indexed by Chebyshev distance from the chunk being worked on.
This is Java's ChunkDependencies. It is monotonically non-increasing in distance, and its length is the number of rings the window covers, so distance size and beyond is outside the window entirely rather than at a low status.
Constructors
Constructor
new ChunkDependencies(
byDistance):ChunkDependencies
Defined in: ChunkStep.ts:14
Parameters
byDistance
readonly ("empty" | "structure_starts" | "structure_references" | "biomes" | "terrain" | "features" | "initialize_light" | "light" | "spawn" | "full")[]
Entry d is the status guaranteed at Chebyshev distance d.
Returns
ChunkDependencies
Properties
byDistance
readonlybyDistance: readonly ("empty"|"structure_starts"|"structure_references"|"biomes"|"terrain"|"features"|"initialize_light"|"light"|"spawn"|"full")[]
Defined in: ChunkStep.ts:14
Entry d is the status guaranteed at Chebyshev distance d.
Accessors
radius
Get Signature
get radius():
number
Defined in: ChunkStep.ts:27
The outermost distance the window reaches, or -1 when the window is empty.
Returns
number
size
Get Signature
get size():
number
Defined in: ChunkStep.ts:22
The number of rings the window covers, counting the chunk itself as one.
Returns
number
Methods
at()
at(
distance):"empty"|"structure_starts"|"structure_references"|"biomes"|"terrain"|"features"|"initialize_light"|"light"|"spawn"|"full"|undefined
Defined in: ChunkStep.ts:17
The status guaranteed at a distance, or undefined when the distance is outside the window.
Parameters
distance
number
Returns
"empty" | "structure_starts" | "structure_references" | "biomes" | "terrain" | "features" | "initialize_light" | "light" | "spawn" | "full" | undefined
radiusOf()
radiusOf(
status):number
Defined in: ChunkStep.ts:40
The radius out to which every chunk is guaranteed to be at status or above.
Java's ChunkDependencies.getRadiusOf. Inverting the full step's accumulated dependencies through it is what sizes each layer of the scheduler: the answer for terrain is 2, so a chunk cannot become full until a 5 by 5 neighborhood has terrain.
Parameters
status
"empty" | "structure_starts" | "structure_references" | "biomes" | "terrain" | "features" | "initialize_light" | "light" | "spawn" | "full"
Returns
number
The outermost such distance, or -1 when no distance reaches that status.