TemplatePiece 5.46.0
Extends StructurePiece
A piece made of one structure template (vanilla's TemplateStructurePiece): the template is placed with its settings, then the data markers are handled and the jigsaw blocks replaced by their final state.
Properties
$templateId
php
public readonly string $templateId$x
php
public int $x$y
php
public int $y$z
php
public int $zMethods
__construct()
php
public function __construct(\pocketmine\world\generator\vanilla\structure\template\StructureTemplates $templates, string $templateId, int $x, int $y, int $z)computeBox() protected
php
protected function computeBox(\pocketmine\world\generator\vanilla\structure\template\StructureTemplates $templates) : \pocketmine\world\generator\vanilla\structure\BoundingBoxhandleDataMarker() protected
php
protected function handleDataMarker(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, string $metadata, int $x, int $y, int $z, \pocketmine\world\generator\vanilla\structure\BoundingBox $box) : voidA data marker of the template (a structure block in data mode with the given metadata) at a world position inside the chunk box.
makeSettings() protected
php
abstract protected function makeSettings(?\pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks) : \pocketmine\world\generator\vanilla\structure\template\PlaceSettingsThe placement settings of the piece (rotation, mirror, pivot, processors); without blocks, only the transform matters (bounding box computation).
move()
php
public function move(int $dx, int $dy, int $dz) : voidplaceTemplate() protected
php
protected function placeTemplate(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\BoundingBox $chunkBox, array $pivot) : boolTemplateStructurePiece.postProcess()
postProcess()
php
public function postProcess(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\BoundingBox $chunkBox, int $chunkX, int $chunkZ, array $pivot) : voidsetTemplateY()
php
public function setTemplateY(\pocketmine\world\generator\vanilla\structure\template\StructureTemplates $templates, int $y) : voidMoves the template (and its box) to another height.
