ItemDataUpgrader
Methods
__construct()
php
public function __construct(\pocketmine\data\bedrock\item\upgrade\ItemIdMetaUpgrader $idMetaUpgrader, \pocketmine\data\bedrock\item\upgrade\LegacyItemIdToStringIdMap $legacyIntToStringIdMap, \pocketmine\data\bedrock\item\upgrade\R12ItemIdToBlockIdMap $r12ItemIdToBlockIdMap, \pocketmine\data\bedrock\block\upgrade\BlockDataUpgrader $blockDataUpgrader, \pocketmine\data\bedrock\item\BlockItemIdMap $bl …getIdMetaUpgrader()
php
public function getIdMetaUpgrader() : \pocketmine\data\bedrock\item\upgrade\ItemIdMetaUpgraderupgradeItemStackNbt()
php
public function upgradeItemStackNbt(\pocketmine\nbt\tag\CompoundTag $tag) : ?\pocketmine\data\bedrock\item\SavedItemStackDataupgradeItemTypeDataInt()
php
public function upgradeItemTypeDataInt(int $legacyNumericId, int $meta, int $count, ?\pocketmine\nbt\tag\CompoundTag $nbt) : \pocketmine\data\bedrock\item\SavedItemStackDataThis function replaces the legacy ItemFactory::get().
upgradeItemTypeDataString()
php
public function upgradeItemTypeDataString(string $rawNameId, int $meta, int $count, ?\pocketmine\nbt\tag\CompoundTag $nbt) : \pocketmine\data\bedrock\item\SavedItemStackDataThis function replaces the legacy ItemFactory::get().
Unlike ItemFactory::get(), it returns a SavedItemStackData which you can do with as you please. If you want to deserialize it into a PocketMine-MP itemstack, pass it to the ItemDeserializer.
