PocketMine-MP 5.15.1 git-5ef247620a7c6301a849b54e5ef1009217729fc8
|
Public Member Functions | |
__construct (private ItemIdMetaUpgrader $idMetaUpgrader, private LegacyItemIdToStringIdMap $legacyIntToStringIdMap, private R12ItemIdToBlockIdMap $r12ItemIdToBlockIdMap, private BlockDataUpgrader $blockDataUpgrader,) | |
getIdMetaUpgrader () | |
upgradeItemStackNbt (CompoundTag $tag) | |
upgradeItemTypeDataInt (int $legacyNumericId, int $meta, int $count, ?CompoundTag $nbt) | |
upgradeItemTypeDataString (string $rawNameId, int $meta, int $count, ?CompoundTag $nbt) | |
Definition at line 41 of file ItemDataUpgrader.php.
pocketmine\data\bedrock\item\upgrade\ItemDataUpgrader::__construct | ( | private ItemIdMetaUpgrader | $idMetaUpgrader, |
private LegacyItemIdToStringIdMap | $legacyIntToStringIdMap, | ||
private R12ItemIdToBlockIdMap | $r12ItemIdToBlockIdMap, | ||
private BlockDataUpgrader | $blockDataUpgrader | ||
) |
Definition at line 44 of file ItemDataUpgrader.php.
pocketmine\data\bedrock\item\upgrade\ItemDataUpgrader::getIdMetaUpgrader | ( | ) |
Definition at line 209 of file ItemDataUpgrader.php.
pocketmine\data\bedrock\item\upgrade\ItemDataUpgrader::upgradeItemStackNbt | ( | CompoundTag | $tag | ) |
SavedDataLoadingException |
Definition at line 180 of file ItemDataUpgrader.php.
pocketmine\data\bedrock\item\upgrade\ItemDataUpgrader::upgradeItemTypeDataInt | ( | int | $legacyNumericId, |
int | $meta, | ||
int | $count, | ||
?CompoundTag | $nbt | ||
) |
This function replaces the legacy ItemFactory::get().
SavedDataLoadingException | if the legacy numeric ID doesn't map to a string ID |
Definition at line 90 of file ItemDataUpgrader.php.
pocketmine\data\bedrock\item\upgrade\ItemDataUpgrader::upgradeItemTypeDataString | ( | string | $rawNameId, |
int | $meta, | ||
int | $count, | ||
?CompoundTag | $nbt | ||
) |
This 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.
Definition at line 59 of file ItemDataUpgrader.php.