ItemFactory::get() now consistently throws SavedDataLoadingException on any error, including unknown items

This commit is contained in:
Dylan K. Taylor
2022-06-27 17:14:43 +01:00
parent 2fd9b751b6
commit 541a624d48
7 changed files with 69 additions and 68 deletions

View File

@ -102,6 +102,8 @@ final class ItemDataUpgrader{
/**
* This function replaces the legacy ItemFactory::get().
*
* @throws SavedDataLoadingException if the legacy numeric ID doesn't map to a string ID
*/
public function upgradeItemTypeDataInt(int $legacyNumericId, int $meta, int $count, ?CompoundTag $nbt) : SavedItemStackData{
$rawNameId = $this->legacyIntToStringIdMap->legacyToString($legacyNumericId);