Skip to content

TemplatePlacer 5.46.0 ​

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

StructureTemplate.placeInWorld() and processBlockInfos(): places a template with its processors, clipped to the settings' box (the chunk being populated). Every processor random is derived from block positions, so a template placed chunk by chunk gives the same blocks as one placed in one pass; the loot seeds of containers come from the chunk's decoration random, like vanilla.

Methods ​

dataMarkers() ​

php
public static function dataMarkers(\pocketmine\world\generator\vanilla\structure\template\TemplateData $template, int $x, int $y, int $z, \pocketmine\world\generator\vanilla\structure\template\PlaceSettings $settings) : array

The data markers of a template (structure blocks in data mode) in the world: [x, y, z, metadata].

lootChest() ​

php
public static function lootChest(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, int $x, int $y, int $z, string $lootTable) : void

Placement of a chest with a loot table at a position, as data markers do (RandomizableContainer.setBlockEntityLootTable()).

paletteIndex() ​

php
public static function paletteIndex(\pocketmine\world\generator\vanilla\structure\template\TemplateData $template, \pocketmine\world\generator\vanilla\structure\template\PlaceSettings $settings, int $x, int $y, int $z) : int

The palette used for a placement at a position (StructurePlaceSettings.getRandomPalette()).

place() ​

php
public static function place(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\template\TemplateData $template, int $x, int $y, int $z, array $pivot, \pocketmine\world\generator\vanilla\structure\template\PlaceSettings $settings) : bool

StructureTemplate.placeInWorld(level, pos, pivot, settings, random, flags)

processBlocks() ​

php
public static function processBlocks(\pocketmine\world\generator\vanilla\structure\StructurePlaceContext $c, \pocketmine\world\generator\vanilla\structure\template\TemplateData $template, int $paletteIndex, int $x, int $y, int $z, array $pivot, \pocketmine\world\generator\vanilla\structure\template\PlaceSettings $settings) : array

processBlockInfos() for the blocks of a palette (all of them, or only those in the settings' box columns when no processor needs the whole list).

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