Skip to content

OrientedPiece 5.46.0 ​

abstract class · pocketmine\world\generator\vanilla\structure\piece\OrientedPiece · source

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 ​

php
protected int $mirror

$orientation protected ​

php
protected ?int $orientation

$rotation protected ​

php
protected int $rotation

Methods ​

canBeReplaced() protected ​

php
protected function canBeReplaced(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, int $x, int $y, int $z, \pocketmine\world\generator\vanilla\structure\BoundingBox $box) : bool

StructurePiece.canBeReplaced(): whether placeBlock() may replace the block at a piece-local position.

createChest() protected ​

php
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) : bool

StructurePiece.createChest() at piece-local coordinates.

createChestAt() ​

php
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) : bool

StructurePiece.createChest() at world coordinates.

createDispenser() protected ​

php
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) : bool

StructurePiece.createDispenser()

fillColumnDown() protected ​

php
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) : void

generateAirBox() protected ​

php
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) : void

generateAirBox()

generateBox() protected ​

php
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) : void

generateBoxWithSelector() protected ​

php
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 ​

php
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) : void

generateMaybeBox(): like generateBox, each block placed with a probability; $requireNonAir skips air blocks, $requireSkylight (vanilla hasToBeInside) skips blocks that are not interior (isInterior()).

generateUpperHalfSphere() protected ​

php
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) : void

generateUpperHalfSphere() (float maths like vanilla)

getBlock() protected ​

php
protected function getBlock(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, int $x, int $y, int $z, \pocketmine\world\generator\vanilla\structure\BoundingBox $box) : int

getOrientation() ​

php
public function getOrientation() : ?int

getWorldPos() protected ​

php
protected function getWorldPos(int $x, int $y, int $z) : array

getWorldX() protected ​

php
protected function getWorldX(int $x, int $z) : int

getWorldY() protected ​

php
protected function getWorldY(int $y) : int

getWorldZ() protected ​

php
protected function getWorldZ(int $x, int $z) : int

isInterior() protected ​

php
protected function isInterior(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, int $x, int $y, int $z, \pocketmine\world\generator\vanilla\structure\BoundingBox $box) : bool

StructurePiece.isInterior(): whether the block above the piece-local position is below the ocean floor heightmap (only inside the chunk box).

isReplaceableByStructures() protected ​

php
protected static function isReplaceableByStructures(\pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks, int $state) : bool

StructurePiece.isReplaceableByStructures()

makeBoundingBox() ​

php
public static function makeBoundingBox(int $x, int $y, int $z, int $direction, int $width, int $height, int $depth) : \pocketmine\world\generator\vanilla\structure\BoundingBox

StructurePiece.makeBoundingBox()

maybeGenerateBlock() protected ​

php
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) : void

placeBlock() protected ​

php
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) : void

placeSpawner() protected ​

php
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) : void

Places a mob spawner of the given Java entity at a piece-local position (placeBlock + SpawnerBlockEntity .setEntityId(), which consumes no randomness).

randomHorizontalDirection() ​

php
public static function randomHorizontalDirection(\pocketmine\world\generator\vanilla\random\LegacyRandom|\pocketmine\world\generator\vanilla\feature\FeatureRandom $random) : int

Direction.Plane.HORIZONTAL.getRandomDirection(random): N, E, S, W.

reorient() protected ​

php
protected static function reorient(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, int $x, int $y, int $z, int $state) : int

StructurePiece.reorient(): a chest facing away from the only solid neighbour.

setOrientation() protected ​

php
protected function setOrientation(?int $direction) : void

spawnMob() protected ​

php
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) : bool

Spawns a mob at the centre of a piece-local block, if the block is in the box.

state() protected ​

php
protected function state(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, string $state) : int

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