Skip to content

DensityFunctionParser 5.46.0 ​

final class · pocketmine\world\generator\vanilla\DensityFunctionParser · source

Builds a seed-bound density function graph from vanilla JSON (port of deepslate's DensityFunction.fromJson + RandomState noise binding, MIT).

Noise settings with a legacy random source (Nether, End) bind some noises differently: the base 3D noise is seeded with a java.util.Random of the world seed, the Nether biome noises use the legacy octave initialization, and the End islands get the world seed.

Constants ​

LEGACY_NETHER_BIOME_NOISES ​

php
public const LEGACY_NETHER_BIOME_NOISES = ["minecraft:temperature" => 0, "minecraft:vegetation" => 1, "minecraft:nether/temperature" => 0, "minecraft:nether/vegetation" => 1]

Noises created with the legacy Nether biome initialization in legacy worlds, with the offset added to the world seed for their random.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\generator\vanilla\WorldgenData $data, \pocketmine\world\generator\vanilla\random\PositionalRandomFactory $random, ?int $legacySeed = null)

getNoise() ​

php
public function getNoise(string $id) : \pocketmine\world\generator\vanilla\noise\NoiseStack

named() ​

php
public function named(string $id) : \pocketmine\world\generator\vanilla\density\NamedFunction

noiseParameters() ​

php
public static function noiseParameters(array $json) : \pocketmine\world\generator\vanilla\noise\NormalNoiseParameters

parse() ​

php
public function parse(mixed $json) : \pocketmine\world\generator\vanilla\density\DensityFunction

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.