StructureTemplates 5.46.0
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 = 600000Default 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) : boolget()
php
public function get(string $id) : \pocketmine\world\generator\vanilla\structure\template\TemplateDatagetLoadedBlockCount()
php
public function getLoadedBlockCount() : intshared()
php
public static function shared(\pocketmine\world\generator\vanilla\WorldgenData $data, \pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks) : selfsize()
php
public function size(string $id) : array