Skip to content

TerrainChunk 5.46.0 ​

final class · pocketmine\world\generator\vanilla\TerrainChunk · source

Output of the terrain stage for one chunk: base materials per block and biome per 4x4x4 cell.

Constants ​

STAGE_CARVED ​

php
public const STAGE_CARVED = 2

After the carvers (final blocks before features).

STAGE_MATERIALS ​

php
public const STAGE_MATERIALS = 1

After the material rules (surface, bedrock, deepslate, ore veins...).

STAGE_TERRAIN ​

php
public const STAGE_TERRAIN = 0

Base materials: Aquifer::MATERIAL_* (air, stone, water, lava).

Properties ​

$biomes ​

php
public array $biomes

Biome index (ClimateBiomeTree names) per quart cell, index ((qx << 2) | qz) * (height >> 2) + (qy - minY / 4).

$carvingMask ​

php
public array $carvingMask

Blocks visited by the carvers (vanilla's carving mask), same index as $materials; empty before the carver stage.

$chunkX ​

php
public readonly int $chunkX

$chunkZ ​

php
public readonly int $chunkZ

$height ​

php
public readonly int $height

$materialBytes ​

php
public ?string $materialBytes

The materials as one byte per block (same index as $materials), from the native core: then $materials is empty.

$materials ​

php
public array $materials

Material per block (Aquifer::MATERIAL_*), index ((x << 4) | z) * height + (y - minY).

$minY ​

php
public readonly int $minY

$palette ​

php
public ?array $palette

Java block ids of the material ids, when they are not the generator's own material palette (native results).

$sections ​

php
public ?array $sections

Subchunks packed by the native core, index 0 = subchunk minY >> 4: [bits per block, word array, palette of material ids] for PalettedBlockArray::fromData(), or null for a subchunk of air only. Then $materials is empty.

$stage ​

php
public int $stage

Generation stage the materials have reached (STAGE_*): the native core can return later stages.

Methods ​

__construct() ​

php
public function __construct(int $chunkX, int $chunkZ, int $minY, int $height)

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