ClimateBiomeTree 5.46.0
Multi-noise biome lookup: nearest climate parameter point in vanilla's R-tree (7 dimensions: temperature, humidity, continentalness, erosion, depth, weirdness, offset), with targets quantized to 1/10000 like vanilla.
The tree is built from the biome parameter points with vanilla's algorithm (same node layout), so ties are resolved in the same order. Nodes are stored in flat int arrays for the search loop.
Methods
__construct()
public function __construct(array $tree)buildTree()
public static function buildTree(array $points) : arrayBuilds the search tree exactly as vanilla's Climate.RTree does (same buckets and child order, so that equal distances resolve to the same biome): nodes are returned in the layout accepted by the constructor.
fromData()
public static function fromData(\pocketmine\world\generator\vanilla\WorldgenData $data, string $dimension = "overworld") : selfUses the tree saved by VanillaDataFetcher when there is one, otherwise builds it from the biome parameters.
getBiomeNames()
public function getBiomeNames() : arraygetSingleBiome()
public function getSingleBiome() : ?intReturns the biome index if the tree has a single biome (see single()), null otherwise.
quantize()
public static function quantize(float $value) : intVanilla quantization: (long) ((float) value * 10000.0F)
readParameterPoints()
public static function readParameterPoints(array $report) : arrayReads the biome parameter points from the data generator's biome_parameters report: {"biomes": [{"biome": id, "parameters": {temperature, humidity, continentalness, erosion, depth, weirdness, offset}}]} where each parameter is a number or a [min, max] pair (unquantized). Order is preserved: it decides ties.
search()
public function search(int $temperature, int $humidity, int $continentalness, int $erosion, int $depth, int $weirdness) : intReturns the biome index (see getBiomeNames()) closest to the quantized target.
searchIsolated()
public function searchIsolated(int $temperature, int $humidity, int $continentalness, int $erosion, int $depth, int $weirdness) : intLike search(), but without the last-result hint and without changing it: the result never depends on earlier searches (vanilla's hint only changes which of several equally close biomes wins).
single()
public static function single(string $biome) : selfA tree with a single biome (every search returns it), for dimensions without a multi-noise biome source.
