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

@@ -38,7 +38,6 @@ use pocketmine\item\enchantment\EnchantmentInstance;
use pocketmine\math\Vector3;
use pocketmine\nbt\LittleEndianNbtSerializer;
use pocketmine\nbt\NBT;
use pocketmine\nbt\NbtDataException;
use pocketmine\nbt\NbtException;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\ListTag;
@@ -606,8 +605,7 @@ class Item implements \JsonSerializable{
* Returns an Item from properties created in an array by {@link Item#jsonSerialize}
* @param mixed[] $data
*
* @throws NbtDataException
* @throws \InvalidArgumentException
* @throws SavedDataLoadingException
*/
final public static function jsonDeserialize(array $data) : Item{
$nbt = "";