Skip to content

NativeTerrainClient 5.46.0 ​

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

One connection to the vanillagen helper, bound to a seed (protocol: native/vanillagen/protocol.go). Not thread-safe: every generator instance (one per async worker) owns its own client.

Constants ​

FLAG_CARVERS ​

php
public const FLAG_CARVERS = 8

Also run the carvers (needs FLAG_MATERIALS).

FLAG_DEEPSLATE_FLOATS ​

php
public const FLAG_DEEPSLATE_FLOATS = 2

FLAG_MATERIALS ​

php
public const FLAG_MATERIALS = 4

Also apply the material rules: chunks come back in the program's own material palette.

FLAG_NO_AQUIFERS ​

php
public const FLAG_NO_AQUIFERS = 1

FLAG_PACKED_SECTIONS ​

php
public const FLAG_PACKED_SECTIONS = 16

Chunks come with their subchunks already packed for PalettedBlockArray::fromData() (TerrainChunk::$sections) and the materials as a byte string (TerrainChunk::$materialBytes) instead of a PHP array: no per-block PHP loop.

MAX_FRAME ​

php
public const MAX_FRAME = 64 << 20

Largest frame accepted (decoration requests carry a whole 3x3 chunk region).

Properties ​

$biomeNames ​

php
public readonly array $biomeNames

$dataFingerprint ​

php
public readonly string $dataFingerprint

$height ​

php
public readonly int $height

$minY ​

php
public readonly int $minY

$palette ​

php
public readonly array $palette

Java block ids of the material ids of chunks past the terrain stage (empty without FLAG_MATERIALS).

$version ​

php
public readonly string $version

Methods ​

__construct() ​

php
public function __construct(string $host, int $port, string $token, string $dataDir, int $seed, int $flags = 0, float $timeout = 60.0, string $settings = "overworld")

__destruct() ​

php
public function __destruct()

close() ​

php
public function close() : void

fill() ​

php
public function fill(int $chunkX, int $chunkZ, ?\pocketmine\world\generator\vanilla\structure\Beardifier $beardifier = null) : \pocketmine\world\generator\vanilla\TerrainChunk

processCpuTime() ​

php
public function processCpuTime() : int

CPU time used so far by the whole vanillagen process, in nanoseconds (benchmarks).

receive() ​

php
public function receive() : string

send() ​

php
public function send(string $payload) : void

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