Skip to content

FeatureDecorator 5.46.0 ​

final class · pocketmine\world\generator\vanilla\feature\FeatureDecorator · source

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 ​

php
public const DECORATION_STEPS = 11

GenerationStep.Decoration count

Properties ​

$blocks ​

php
public readonly \pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks

$context ​

php
public readonly \pocketmine\world\generator\vanilla\feature\FeatureContext $context

$featuresEnabled ​

php
public bool $featuresEnabled

Whether the decoration features are placed (structures can be generated without them).

$level ​

php
public readonly \pocketmine\world\generator\vanilla\feature\FeatureLevel $level

$profile ​

php
public ?array $profile

Nanoseconds spent per placed feature id (null: not profiled). Development aid for tools/.

$regionRandomFactory ​

php
public ?\pocketmine\world\generator\vanilla\random\PositionalRandomFactory $regionRandomFactory

RandomState.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 ​

php
public readonly \pocketmine\world\generator\vanilla\feature\FeatureRegistry $registry

$structures ​

php
public ?\pocketmine\world\generator\vanilla\structure\StructureManager $structures

Structures placed at the start of each decoration step (null: no structures).

Methods ​

__construct() ​

php
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() ​

php
public function decorate(\pocketmine\world\ChunkManager $world, int $chunkX, int $chunkZ) : void

Decorates the chunk; its 3x3 neighbours must be available in the chunk manager (they may be modified too).

enableNative() ​

php
public function enableNative(\pocketmine\world\generator\vanilla\native\NativeTerrainClient $client) : bool

Lets 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() ​

php
public function getNative() : ?\pocketmine\world\generator\vanilla\native\NativeDecorator

placeFeature() ​

php
public function placeFeature(\pocketmine\world\ChunkManager $world, string $feature, int $x, int $y, int $z, int $randomSeed) : bool

Places 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() ​

php
public function recordTerrain(int $chunkX, int $chunkZ, \pocketmine\world\format\Chunk $chunk) : void

Records 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.

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