Skip to content

TemplatePiece 5.46.0 ​

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

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 $z

Methods ​

__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\BoundingBox

handleDataMarker() 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) : void

A 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\PlaceSettings

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

placeTemplate() protected ​

php
protected function placeTemplate(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\BoundingBox $chunkBox, array $pivot) : bool

TemplateStructurePiece.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) : void

setTemplateY() ​

php
public function setTemplateY(\pocketmine\world\generator\vanilla\structure\template\StructureTemplates $templates, int $y) : void

Moves the template (and its box) to another height.

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