FeatureDecorator 5.46.0
Vanilla's biome decoration (ChunkGenerator.applyBiomeDecoration) for one chunk, with its 3x3 neighbours as the region: for every decoration step, every feature of the biomes present in the region is placed in the global feature order, each with its random seeded by WorldgenRandom.setFeatureSeed(decorationSeed, featureIndex, step).
Decoration follows Java Edition 26.3 exactly for the same seed (Bedrock's own decoration is different code inside the game and is not public); the blocks are mapped to their Bedrock equivalents.
Constants
DECORATION_STEPS
public const DECORATION_STEPS = 11GenerationStep.Decoration count
Properties
$blocks
public readonly \pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks$context
public readonly \pocketmine\world\generator\vanilla\feature\FeatureContext $context$featuresEnabled
public bool $featuresEnabledWhether the decoration features are placed (structures can be generated without them).
$level
public readonly \pocketmine\world\generator\vanilla\feature\FeatureLevel $level$profile
public ?array $profileNanoseconds spent per placed feature id (null: not profiled). Development aid for tools/.
$regionRandomFactory
public ?\pocketmine\world\generator\vanilla\random\PositionalRandomFactory $regionRandomFactoryRandomState.getOrCreateRandomFactory("minecraft:worldgen_region_random"): WorldGenRegion.getRandom() of a chunk being decorated is this factory at the chunk's origin (null: not set by the generator).
$registry
public readonly \pocketmine\world\generator\vanilla\feature\FeatureRegistry $registry$structures
public ?\pocketmine\world\generator\vanilla\structure\StructureManager $structuresStructures placed at the start of each decoration step (null: no structures).
Methods
__construct()
public function __construct(\pocketmine\world\generator\vanilla\WorldgenData $data, int $seed, int $minY, int $height, int $seaLevel, array $treeBiomeNames, \Closure $sampleTreeBiome, ?\Closure $logger = null, ?array $possibleBiomes = null)decorate()
public function decorate(\pocketmine\world\ChunkManager $world, int $chunkX, int $chunkZ) : voidDecorates the chunk; its 3x3 neighbours must be available in the chunk manager (they may be modified too).
enableNative()
public function enableNative(\pocketmine\world\generator\vanilla\native\NativeTerrainClient $client) : boolLets the native core place the features it implements, on the connection of the native terrain client. Returns false (and logs why) if it cannot be used.
getNative()
public function getNative() : ?\pocketmine\world\generator\vanilla\native\NativeDecoratorplaceFeature()
public function placeFeature(\pocketmine\world\ChunkManager $world, string $feature, int $x, int $y, int $z, int $randomSeed) : boolPlaces one configured feature (worldgen/feature id) at a position with a random seeded from $randomSeed, like vanilla's /place feature. The 3x3 chunks around the position must be available in the chunk manager.
recordTerrain()
public function recordTerrain(int $chunkX, int $chunkZ, \pocketmine\world\format\Chunk $chunk) : voidRecords the terrain heightmaps of a freshly generated (not yet decorated) chunk: vanilla features see the WORLD_SURFACE_WG / OCEAN_FLOOR_WG heightmaps as they were after the terrain step.
