Skip to content

StructureTemplates 5.46.0 ​

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

The structure templates of a data cache, loaded on demand and kept in a least-recently-used cache bounded by the total number of template blocks (templates of big structures like ancient cities are tens of thousands of blocks), so a generator worker stays within its memory limit. One instance per data directory and thread (see shared()).

Constants ​

DEFAULT_BLOCK_BUDGET ​

php
public const DEFAULT_BLOCK_BUDGET = 600000

Default budget: about 10 MB of packed blocks (generator workers have a 256 MB memory limit).

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\generator\vanilla\WorldgenData $data, \pocketmine\world\generator\vanilla\feature\block\JavaBlocks $javaBlocks, int $blockBudget = self::DEFAULT_BLOCK_BUDGET)

exists() ​

php
public function exists(string $id) : bool

get() ​

php
public function get(string $id) : \pocketmine\world\generator\vanilla\structure\template\TemplateData

getLoadedBlockCount() ​

php
public function getLoadedBlockCount() : int

shared() ​

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

size() ​

php
public function size(string $id) : array

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