Skip to content

TerrainSampler 5.46.0 ​

final class · pocketmine\world\generator\vanilla\structure\TerrainSampler · source

The terrain as structure starts see it (vanilla's ChunkGenerator.getBaseHeight() / getBaseColumn(): the noise terrain of a column, without generating the chunk). Built from the terrain filler (the native core when it runs), one chunk at a time, and kept in small least-recently-used caches: a packed column kind per block (KIND_*: air, solid, water, lava) and the WORLD_SURFACE_WG / OCEAN_FLOOR_WG heights.

Constants ​

KIND_AIR ​

php
public const KIND_AIR = 0

KIND_LAVA ​

php
public const KIND_LAVA = 3

KIND_SOLID ​

php
public const KIND_SOLID = 1

KIND_WATER ​

php
public const KIND_WATER = 2

OCEAN_FLOOR_WG ​

php
public const OCEAN_FLOOR_WG = 1

WORLD_SURFACE_WG ​

php
public const WORLD_SURFACE_WG = 0

Properties ​

$chunkFills ​

php
public int $chunkFills

$height ​

php
public readonly int $height

$minY ​

php
public readonly int $minY

Methods ​

__construct() ​

php
public function __construct(\Closure $fill, int $minY, int $height, ?\Closure $knownHeights = null)

chunkKinds() ​

php
public function chunkKinds(int $chunkX, int $chunkZ) : string

Kind per block of a chunk's terrain (packed string).

getFirstFreeHeight() ​

php
public function getFirstFreeHeight(int $x, int $z, int $type) : int

ChunkGenerator.getFirstFreeHeight() / getBaseHeight(): first free y above the terrain of the column.

getFirstOccupiedHeight() ​

php
public function getFirstOccupiedHeight(int $x, int $z, int $type) : int

ChunkGenerator.getFirstOccupiedHeight(): the highest terrain block of the column.

getKind() ​

php
public function getKind(int $x, int $y, int $z) : int

Kind of the terrain block at a position (getBaseColumn()).

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