StructureGenContext 5.46.0
Vanilla's Structure.GenerationContext: what a structure type sees while it computes a start in a chunk.
Properties
$chunkX
public readonly int $chunkX$chunkZ
public readonly int $chunkZ$env
public readonly \pocketmine\world\generator\vanilla\structure\StructureEnvironment $env$random
public readonly \pocketmine\world\generator\vanilla\random\LegacyRandom $randomMethods
__construct()
public function __construct(\pocketmine\world\generator\vanilla\structure\StructureEnvironment $env, int $chunkX, int $chunkZ)averageHeight()
public function averageHeight(\pocketmine\world\generator\vanilla\structure\BoundingBox $box, int $heightmap) : intThe 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()
public function averageHeightInStartChunk(\pocketmine\world\generator\vanilla\structure\BoundingBox $box, int $heightmap) : intScatteredFeaturePiece.updateAverageGroundHeight() run in the start chunk: the mean terrain height of the box columns inside the start chunk.
getLowestY()
public function getLowestY(int $x, int $z, int $width, int $depth) : intStructure.getLowestY(context, x, z, width, depth): the lowest terrain of the four corners of the area.
getLowestYIn5by5Box()
public function getLowestYIn5by5Box(int $blockX, int $blockZ, int $rotation) : intStructure.getLowestYIn5by5Box(): the lowest terrain of the corners of the 5x5 area the rotation points to.
getMeanFirstOccupiedHeight()
public function getMeanFirstOccupiedHeight(int $x, int $z, int $width, int $depth, int $heightmap) : intStructure.getMeanFirstOccupiedHeight(context, x, z, width, depth): the mean terrain of the four corners.
getMinBlockX()
public function getMinBlockX() : intgetMinBlockZ()
public function getMinBlockZ() : intonTopOfChunkCenter()
public function onTopOfChunkCenter(int $heightmap) : arrayStructure.onTopOfChunkCenter(): position on the terrain at the centre of the chunk.
startChunkDecorationRandom()
public function startChunkDecorationRandom(string $structureId) : \pocketmine\world\generator\vanilla\feature\FeatureRandomThe 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.
