OrientedPiece 5.46.0
Extends StructurePiece
A piece built by code in piece-local coordinates, rotated and mirrored by its orientation (vanilla's StructurePiece helpers: getWorldX/Y/Z, placeBlock, generateBox, fillColumnDown, createChest...).
Properties
$mirror protected
protected int $mirror$orientation protected
protected ?int $orientation$rotation protected
protected int $rotationMethods
canBeReplaced() protected
protected function canBeReplaced(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, int $x, int $y, int $z, \pocketmine\world\generator\vanilla\structure\BoundingBox $box) : boolStructurePiece.canBeReplaced(): whether placeBlock() may replace the block at a piece-local position.
createChest() protected
protected function createChest(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\BoundingBox $box, \pocketmine\world\generator\vanilla\feature\FeatureRandom $random, int $x, int $y, int $z, string $lootTable, ?int $state = null) : boolStructurePiece.createChest() at piece-local coordinates.
createChestAt()
public static function createChestAt(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\BoundingBox $box, \pocketmine\world\generator\vanilla\feature\FeatureRandom $random, int $x, int $y, int $z, string $lootTable, ?int $state = null) : boolStructurePiece.createChest() at world coordinates.
createDispenser() protected
protected function createDispenser(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\BoundingBox $box, \pocketmine\world\generator\vanilla\feature\FeatureRandom $random, int $x, int $y, int $z, int $facing, string $lootTable) : boolStructurePiece.createDispenser()
fillColumnDown() protected
protected function fillColumnDown(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, int $state, int $x, int $y, int $z, \pocketmine\world\generator\vanilla\structure\BoundingBox $box) : voidgenerateAirBox() protected
protected function generateAirBox(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\BoundingBox $box, int $minX, int $minY, int $minZ, int $maxX, int $maxY, int $maxZ) : voidgenerateAirBox()
generateBox() protected
protected function generateBox(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\BoundingBox $box, int $minX, int $minY, int $minZ, int $maxX, int $maxY, int $maxZ, int $edge, int $fill, bool $skipAir) : voidgenerateBoxWithSelector() protected
protected function generateBoxWithSelector(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\BoundingBox $box, int $minX, int $minY, int $minZ, int $maxX, int $maxY, int $maxZ, bool $skipAir, \pocketmine\world\generator\vanilla\feature\FeatureRandom $random, \pocketmine\world\generator\vanilla\structure\piece\BlockSelector $select …generateBox() with a BlockSelector.
generateMaybeBox() protected
protected function generateMaybeBox(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\BoundingBox $box, \pocketmine\world\generator\vanilla\feature\FeatureRandom $random, float $probability, int $minX, int $minY, int $minZ, int $maxX, int $maxY, int $maxZ, int $edge, int $fill, bool $requireNonAir, bool $requireSkylight) : voidgenerateMaybeBox(): like generateBox, each block placed with a probability; $requireNonAir skips air blocks, $requireSkylight (vanilla hasToBeInside) skips blocks that are not interior (isInterior()).
generateUpperHalfSphere() protected
protected function generateUpperHalfSphere(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\BoundingBox $box, int $x0, int $y0, int $z0, int $x1, int $y1, int $z1, int $state, bool $skipAir) : voidgenerateUpperHalfSphere() (float maths like vanilla)
getBlock() protected
protected function getBlock(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, int $x, int $y, int $z, \pocketmine\world\generator\vanilla\structure\BoundingBox $box) : intgetOrientation()
public function getOrientation() : ?intgetWorldPos() protected
protected function getWorldPos(int $x, int $y, int $z) : arraygetWorldX() protected
protected function getWorldX(int $x, int $z) : intgetWorldY() protected
protected function getWorldY(int $y) : intgetWorldZ() protected
protected function getWorldZ(int $x, int $z) : intisInterior() protected
protected function isInterior(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, int $x, int $y, int $z, \pocketmine\world\generator\vanilla\structure\BoundingBox $box) : boolStructurePiece.isInterior(): whether the block above the piece-local position is below the ocean floor heightmap (only inside the chunk box).
isReplaceableByStructures() protected
protected static function isReplaceableByStructures(\pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks, int $state) : boolStructurePiece.isReplaceableByStructures()
makeBoundingBox()
public static function makeBoundingBox(int $x, int $y, int $z, int $direction, int $width, int $height, int $depth) : \pocketmine\world\generator\vanilla\structure\BoundingBoxStructurePiece.makeBoundingBox()
maybeGenerateBlock() protected
protected function maybeGenerateBlock(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\BoundingBox $box, \pocketmine\world\generator\vanilla\feature\FeatureRandom $random, float $probability, int $x, int $y, int $z, int $state) : voidplaceBlock() protected
protected function placeBlock(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, int $state, int $x, int $y, int $z, \pocketmine\world\generator\vanilla\structure\BoundingBox $box) : voidplaceSpawner() protected
protected function placeSpawner(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\BoundingBox $box, int $x, int $y, int $z, string $javaEntity) : voidPlaces a mob spawner of the given Java entity at a piece-local position (placeBlock + SpawnerBlockEntity .setEntityId(), which consumes no randomness).
randomHorizontalDirection()
public static function randomHorizontalDirection(\pocketmine\world\generator\vanilla\random\LegacyRandom|\pocketmine\world\generator\vanilla\feature\FeatureRandom $random) : intDirection.Plane.HORIZONTAL.getRandomDirection(random): N, E, S, W.
reorient() protected
protected static function reorient(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, int $x, int $y, int $z, int $state) : intStructurePiece.reorient(): a chest facing away from the only solid neighbour.
setOrientation() protected
protected function setOrientation(?int $direction) : voidspawnMob() protected
protected function spawnMob(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\BoundingBox $box, string $javaEntity, int $x, int $y, int $z) : boolSpawns a mob at the centre of a piece-local block, if the block is in the box.
state() protected
protected function state(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, string $state) : int