Skip to content

NativeDecorator 5.46.0 ​

final class · pocketmine\world\generator\vanilla\native\NativeDecorator · source

Decoration features placed by the native core (native/vanillagen/decor), on the connection of the generator's NativeTerrainClient.

The native side keeps its own copy of the decoration region (sent by begin(), as Java block states) and places the features it implements, in the global feature order, in batches of consecutive features (place()). Both sides apply every write of the other in order: the writes of PHP features and structures are logged by FeatureLevel and sent with the next batch, and the native writes come back and are applied with FeatureLevel::setState(). The result is exactly the PHP decoration.

Properties ​

$stats ​

php
public array $stats

Time (ns) and counters for benchmarks: begin, place (whole requests), apply (PHP side of the native writes), writes, batches.

$unsupported ​

php
public array $unsupported

Features left to PHP and why (from the native side), for diagnostics.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\generator\vanilla\native\NativeTerrainClient $client, \pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks, int $minY, int $height, int $seaLevel, array $biomeNames, array $bedrockToJava, array $terrainToRegistry, array $stepFeatures)

begin() ​

php
public function begin(\pocketmine\world\generator\vanilla\feature\FeatureLevel $level, int $chunkX, int $chunkZ, array $recordedHeights) : void

Sends the decoration region (after FeatureLevel::begin()).

isNative() ​

php
public function isNative(int $step, int $index) : bool

nativeCount() ​

php
public function nativeCount() : int

place() ​

php
public function place(\pocketmine\world\generator\vanilla\feature\FeatureLevel $level, \pocketmine\world\generator\vanilla\feature\FeatureRandom $random, int $decorationSeed, array $features) : void

Places a batch of consecutive natively placed features (in order) and applies their writes to the level.

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