NativeTerrainFiller 5.46.0
Implements TerrainFiller
Terrain filler backed by the vanillagen helper process: same output as the PHP fillers, several times faster. On any failure (helper missing, crashed, too old...) it logs once and permanently switches this generator to the PHP filler built by the fallback factory.
Methods
__construct()
php
public function __construct(?\pocketmine\world\generator\vanilla\native\NativeTerrainClient $client, \Closure $fallbackFactory)connect()
php
public static function connect(string $dataDir, int $seed, array $biomeNames, int $minY, int $height, \Closure $fallbackFactory, int $flags = 0, string $settings = "overworld") : ?selfConnects to the helper published by the main thread (VanillaNativeBackend). Returns null (and logs why, unless no helper was published) if the native core cannot be used.
fill()
php
public function fill(int $chunkX, int $chunkZ, ?\pocketmine\world\generator\vanilla\structure\Beardifier $beardifier = null) : \pocketmine\world\generator\vanilla\TerrainChunkgetClient()
php
public function getClient() : ?\pocketmine\world\generator\vanilla\native\NativeTerrainClient