Skip to content

BlockIdMetaUpgrader ​

final class · pocketmine\data\bedrock\block\upgrade\BlockIdMetaUpgrader · source

Handles translating legacy 1.12 block ID/meta into modern blockstates.

Methods ​

__construct() ​

php
public function __construct(array $mappingTable, \pocketmine\data\bedrock\block\upgrade\LegacyBlockIdToStringIdMap $legacyNumericIdMap)

addIdMetaToStateMapping() ​

php
public function addIdMetaToStateMapping(string $stringId, int $meta, \pocketmine\data\bedrock\block\BlockStateData $stateData) : void

Adds a mapping of legacy block ID and meta to modern blockstate data. This may be needed for upgrading data from stored custom blocks from older versions of PocketMine-MP.

addIntIdToStringIdMapping() ​

php
public function addIntIdToStringIdMapping(int $intId, string $stringId) : void

Adds a mapping of legacy block numeric ID to modern string ID. This is used for upgrading blocks from pre-1.2.13 worlds (PM3). It's also needed for upgrading flower pot contents and falling blocks from PM4 worlds.

fromIntIdMeta() ​

php
public function fromIntIdMeta(int $id, int $meta) : \pocketmine\data\bedrock\block\BlockStateData

fromStringIdMeta() ​

php
public function fromStringIdMeta(string $id, int $meta) : \pocketmine\data\bedrock\block\BlockStateData

loadFromString() ​

php
public static function loadFromString(string $data, \pocketmine\data\bedrock\block\upgrade\LegacyBlockIdToStringIdMap $idMap, \pocketmine\data\bedrock\block\upgrade\BlockStateUpgrader $blockStateUpgrader) : self

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