PocketMine-MP 5.18.1 git-9381fc4172e5dce4cada1cb356050c8a2ab57b94
pocketmine\data\bedrock\item\upgrade\R12ItemIdToBlockIdMap Class Reference
+ Collaboration diagram for pocketmine\data\bedrock\item\upgrade\R12ItemIdToBlockIdMap:

Public Member Functions

 __construct (array $itemToBlock)
 
 blockIdToItemId (string $blockId)
 
 itemIdToBlockId (string $itemId)
 

Detailed Description

Maps all known 1.12 and lower item IDs to their respective block IDs, where appropriate. If an item ID does not have a corresponding 1.12 block ID, assume the item is not a blockitem.

This is only needed for deserializing blockitems from 1.8 and lower (or 1.12 and lower in the case of PM). In 1.9 and above, the blockstate NBT is stored in the itemstack NBT, and the item ID is not used.

Definition at line 45 of file R12ItemIdToBlockIdMap.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\data\bedrock\item\upgrade\R12ItemIdToBlockIdMap::__construct ( array  $itemToBlock)
Parameters
string[]$itemToBlock@phpstan-param array<string, string> $itemToBlock

Definition at line 87 of file R12ItemIdToBlockIdMap.php.

References pocketmine\utils\Utils\stringifyKeys().

+ Here is the call graph for this function:

Member Function Documentation

◆ blockIdToItemId()

pocketmine\data\bedrock\item\upgrade\R12ItemIdToBlockIdMap::blockIdToItemId ( string  $blockId)

Definition at line 98 of file R12ItemIdToBlockIdMap.php.

◆ itemIdToBlockId()

pocketmine\data\bedrock\item\upgrade\R12ItemIdToBlockIdMap::itemIdToBlockId ( string  $itemId)

Definition at line 94 of file R12ItemIdToBlockIdMap.php.


The documentation for this class was generated from the following file: