StructureTemplateStorage 5.47.0
The structure templates of a world, like vanilla's StructureManager: templates saved "in memory" only live until the server stops; templates saved "to disk" are written to the world database under the vanilla key "structuretemplate_<name>", so they round-trip with Bedrock Dedicated Server (worlds which are not LevelDB worlds keep them as .mcstructure files in a "structures" folder). Recently loaded templates are cached (the structure block screen queries the template of its name again and again): a few small ones, and the last one too big for them.
Constants
LEVELDB_KEY_PREFIX
public const LEVELDB_KEY_PREFIX = "structuretemplate_"Methods
delete()
public function delete(string $name) : boolDeletes the template of the given name from memory and disk. Returns whether there was one.
get()
public static function get(\pocketmine\world\World $world) : selfload()
public function load(string $name) : ?\pocketmine\world\structure\StructureTemplateReturns the template of the given name (memory first, then disk), or null if there is none.
save()
public function save(string $name, \pocketmine\world\structure\StructureTemplate $template, bool $toDisk) : voidSaves a template in memory, or to disk.
