Skip to content

MaterialContext 5.46.0 ​

final class · pocketmine\world\generator\vanilla\surface\MaterialContext · source

State of the block being decorated by the material rules (vanilla's material rule context): position, depth of solid blocks above/below, fluid level above, the column's surface depth noise, plus lazily computed column and block values (secondary surface noise, preliminary surface level, steepness, biome).

Properties ​

$biomes ​

php
public readonly \pocketmine\world\generator\vanilla\surface\SurfaceBiomes $biomes

$blockStamp ​

php
public int $blockStamp

$blockX ​

php
public int $blockX

$blockY ​

php
public int $blockY

$blockZ ​

php
public int $blockZ

$chunkStamp ​

php
public int $chunkStamp

Incremented for every chunk / column / block, for caches.

$columnStamp ​

php
public int $columnStamp

$height ​

php
public readonly int $height

$heights ​

php
public array $heights

Highest non-air block per column ((x << 4) | z), like the WORLD_SURFACE_WG heightmap; kept up to date while blocks are changed.

$interpolation ​

php
public readonly \pocketmine\world\generator\vanilla\surface\InterpolationCache $interpolation

$localX ​

php
public int $localX

$localZ ​

php
public int $localZ

$minY ​

php
public readonly int $minY

$seaLevel ​

php
public readonly int $seaLevel

$stoneDepthAbove ​

php
public int $stoneDepthAbove

$stoneDepthBelow ​

php
public int $stoneDepthBelow

$surfaceDepth ​

php
public int $surfaceDepth

Per column: (int) (surface noise * 2.75 + 3 + random * 0.25)

$waterHeight ​

php
public int $waterHeight

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\generator\vanilla\noise\NoiseStack $surfaceNoise, \pocketmine\world\generator\vanilla\noise\NoiseStack $surfaceSecondaryNoise, \pocketmine\world\generator\vanilla\random\PositionalRandomFactory $random, \pocketmine\world\generator\vanilla\density\DensityFunction $chunkSurfaceLevel, \pocketmine\world\generator\vanilla\surface\InterpolationCache $interpo …

beginChunk() ​

php
public function beginChunk() : void

biome() ​

php
public function biome() : int

minSurfaceLevel() ​

php
public function minSurfaceLevel() : int

Preliminary surface level of the column (interpolated per chunk) + surface depth - 8.

noise2d() ​

php
public function noise2d(\pocketmine\world\generator\vanilla\noise\NoiseStack $noise) : float

noise3d() ​

php
public function noise3d(\pocketmine\world\generator\vanilla\noise\NoiseStack $noise) : float

steep() ​

php
public function steep() : bool

Steep slope facing south (along z) or west (along x), from the heights of the neighbouring columns in the chunk.

surfaceSecondary() ​

php
public function surfaceSecondary() : float

updateXZ() ​

php
public function updateXZ(int $localX, int $localZ, int $blockX, int $blockZ) : void

updateY() ​

php
public function updateY(int $stoneDepthAbove, int $stoneDepthBelow, int $waterHeight, int $y) : void

Moves to another block of the column (MaterialSystem sets the same fields inline in its loop).

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