Skip to content

StructureTemplate 5.46.0 ​

final class · pocketmine\world\generator\vanilla\feature\template\StructureTemplate · source

A structure template (data/minecraft/structure/*.nbt) with the palettes in vanilla's placement order (StructureTemplate.buildInfoList(): full blocks, then other blocks, then block entities, each sorted by y, x, z), and its placement (StructureTemplate.placeInWorld()) without entities and shape updates.

Constants ​

ROTATION_CLOCKWISE_180 ​

php
public const ROTATION_CLOCKWISE_180 = 2

ROTATION_CLOCKWISE_90 ​

php
public const ROTATION_CLOCKWISE_90 = 1

ROTATION_COUNTERCLOCKWISE_90 ​

php
public const ROTATION_COUNTERCLOCKWISE_90 = 3

ROTATION_NAMES ​

php
public const ROTATION_NAMES = ["none", "clockwise_90", "180", "counterclockwise_90"]

ROTATION_NONE ​

php
public const ROTATION_NONE = 0

Properties ​

$palettes ​

php
public array $palettes

$sizeX ​

php
public readonly int $sizeX

$sizeY ​

php
public readonly int $sizeY

$sizeZ ​

php
public readonly int $sizeZ

Methods ​

__construct() ​

php
public function __construct(int $sizeX, int $sizeY, int $sizeZ)

getBoundingBox() ​

php
public function getBoundingBox(int $x, int $y, int $z, int $rotation) : array

getBoundingBox(settings, position): [minX, minY, minZ, maxX, maxY, maxZ]

getSize() ​

php
public function getSize(int $rotation) : array

getSize(rotation)

load() ​

php
public static function load(\pocketmine\world\generator\vanilla\WorldgenData $data, \pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks, string $id) : self

rotateDirection() ​

php
public static function rotateDirection(int $direction, int $rotation) : int

rotateState() ​

php
public function rotateState(\pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks, int $state, int $rotation) : int

BlockState.rotate() for the common rotatable properties.

transform() ​

php
public static function transform(int $x, int $z, int $rotation) : array

StructureTemplate.transform() with no mirror and the pivot at the origin.

zeroPositionOffset() ​

php
public function zeroPositionOffset(int $rotation) : array

getZeroPositionWithTransform(zeroPos, Mirror.NONE, rotation): offset of the zero position.

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