Skip to content

TemplateData 5.46.0 ​

final class · pocketmine\world\generator\vanilla\structure\template\TemplateData · source

A structure template (data/minecraft/structure/*.nbt) in a compact form for structure generation: blocks are packed ints (x | y << 10 | z << 20 | palette entry << 30) in vanilla's placement order (StructureTemplate.buildInfoList(): full blocks, then other blocks, then blocks with block entity data, each sorted by y, x, z), with the jigsaw blocks, data markers and entities extracted.

Constants ​

COORD_MASK ​

php
public const COORD_MASK = 0x3ff

Properties ​

$blockCount ​

php
public int $blockCount

$blockNbt ​

php
public array $blockNbt

Block entity data by packed position (x | y << 10 | z << 20).

$dataMarkers ​

php
public array $dataMarkers

Structure blocks in data mode (x, y, z, metadata), first palette.

$entities ​

php
public array $entities

Entities: [x, y, z (exact position), block x, y, z, Java entity data].

$id ​

php
public readonly string $id

$jigsaws ​

php
public array $jigsaws

Jigsaw blocks of the first palette, in placement order.

$palettes ​

php
public array $palettes

Packed blocks per palette, as binary strings of 64-bit little-endian ints (8 bytes per block instead of ~40 for a PHP array: the templates of big structures are hundreds of thousands of blocks).

$sizeX ​

php
public readonly int $sizeX

$sizeY ​

php
public readonly int $sizeY

$sizeZ ​

php
public readonly int $sizeZ

$states ​

php
public array $states

Java state of each palette entry, per palette.

Methods ​

__construct() ​

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

blocks() ​

php
public function blocks(int $palette) : array

The packed blocks of a palette (see pack()), in placement order.

load() ​

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

pack() ​

php
public static function pack(int $x, int $y, int $z, int $entry) : int

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