Skip to content

API reference / @jsprismarine/worldgen / ClimateParameterList

Class: ClimateParameterList<T> ​

Defined in: biome/Climate.ts:561

A list of climate boxes with the search tree Java builds over it.

The tree is an exact nearest-box index, not an approximation: it skips a subtree when its lower-bound distance is worse than the best box found so far, or when an equal bound contains no leaf earlier in tree order. findBruteForce is the same query by linear scan, and the two agree on the nearest distance for every target.

Two boxes can sit at exactly the same distance from a target. Java breaks that tie in favor of the box a thread found last, so its answer depends on that thread's earlier lookups. This list keeps Java's prior-result seed for pruning, but uses the first depth-first leaf rank to settle exact ties. A lookup then depends on the target alone, and chunks generated in any order see the same biomes.

Type Parameters ​

T ​

T

Implements ​

Constructors ​

Constructor ​

new ClimateParameterList<T>(entries, childrenPerNode?): ClimateParameterList<T>

Defined in: biome/Climate.ts:567

Parameters ​

entries ​

readonly ClimateEntry<T>[]

The boxes, in the order the data pack lists them.

childrenPerNode? ​

number = CLIMATE_CHILDREN_PER_NODE

Returns ​

ClimateParameterList<T>

Properties ​

entries ​

readonly entries: readonly ClimateEntry<T>[]

Defined in: biome/Climate.ts:569

The boxes, in the order the data pack lists them.

Implementation of ​

ClimateParameterIndex.entries

Methods ​

distinctValues() ​

distinctValues(): readonly T[]

Defined in: biome/Climate.ts:607

Returns unique entry values in first-occurrence order.

Returns ​

readonly T[]

Implementation of ​

ClimateParameterIndex.distinctValues


find() ​

find(target): T

Defined in: biome/Climate.ts:582

Returns the value of the nearest box, breaking exact ties by first tree order.

Parameters ​

target ​

ClimateTargetPoint

Returns ​

T

Implementation of ​

ClimateParameterIndex.find


findBruteForce() ​

findBruteForce(target): T

Defined in: biome/Climate.ts:591

Returns the value of the box nearest the target by scanning every box.

Parameters ​

target ​

ClimateTargetPoint

Returns ​

T

Implementation of ​

ClimateParameterIndex.findBruteForce


toSharedArrayBuffer() ​

toSharedArrayBuffer(this): SharedArrayBuffer

Defined in: biome/Climate.ts:618

Copies this string-valued climate tree into a read-only-by-convention shared buffer.

The worker receives a handle to the same flattened search arrays instead of rebuilding the 7594-entry tree and retaining a second object graph. The source entries remain in the buffer so diagnostics can still materialize entries and run the brute-force oracle.

Parameters ​

this ​

ClimateParameterList<string>

Returns ​

SharedArrayBuffer