Skip to content

StructureGenContext 5.46.0 ​

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

Vanilla's Structure.GenerationContext: what a structure type sees while it computes a start in a chunk.

Properties ​

$chunkX ​

php
public readonly int $chunkX

$chunkZ ​

php
public readonly int $chunkZ

$env ​

php
public readonly \pocketmine\world\generator\vanilla\structure\StructureEnvironment $env

$random ​

php
public readonly \pocketmine\world\generator\vanilla\random\LegacyRandom $random

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\generator\vanilla\structure\StructureEnvironment $env, int $chunkX, int $chunkZ)

averageHeight() ​

php
public function averageHeight(\pocketmine\world\generator\vanilla\structure\BoundingBox $box, int $heightmap) : int

The mean first free height of the columns of a box (ScatteredFeaturePiece.updateAverageGroundHeight(), computed over the whole box at start time so every chunk sees the same height).

averageHeightInStartChunk() ​

php
public function averageHeightInStartChunk(\pocketmine\world\generator\vanilla\structure\BoundingBox $box, int $heightmap) : int

ScatteredFeaturePiece.updateAverageGroundHeight() run in the start chunk: the mean terrain height of the box columns inside the start chunk.

getLowestY() ​

php
public function getLowestY(int $x, int $z, int $width, int $depth) : int

Structure.getLowestY(context, x, z, width, depth): the lowest terrain of the four corners of the area.

getLowestYIn5by5Box() ​

php
public function getLowestYIn5by5Box(int $blockX, int $blockZ, int $rotation) : int

Structure.getLowestYIn5by5Box(): the lowest terrain of the corners of the 5x5 area the rotation points to.

getMeanFirstOccupiedHeight() ​

php
public function getMeanFirstOccupiedHeight(int $x, int $z, int $width, int $depth, int $heightmap) : int

Structure.getMeanFirstOccupiedHeight(context, x, z, width, depth): the mean terrain of the four corners.

getMinBlockX() ​

php
public function getMinBlockX() : int

getMinBlockZ() ​

php
public function getMinBlockZ() : int

onTopOfChunkCenter() ​

php
public function onTopOfChunkCenter(int $heightmap) : array

Structure.onTopOfChunkCenter(): position on the terrain at the centre of the chunk.

startChunkDecorationRandom() ​

php
public function startChunkDecorationRandom(string $structureId) : \pocketmine\world\generator\vanilla\feature\FeatureRandom

The random a structure's piece gets in postProcess() when the start chunk is decorated (the chunk's decoration seed with the structure's index in its decoration step). Vanilla reads some heights and offsets in the first chunk of a piece that is decorated; these values are taken as if it is the start chunk, so every chunk agrees.

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