mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 15:41:33 +00:00
Document that Item::setNamedTag() may cause NbtException to be thrown
if the NBT is bogus for some reason in PM3, these kinds of bugs wouldn't show up until/unless the item NBT was actually used, but on PM4, we decode it ahead of time, so the errors always show up immediately.
This commit is contained in:
@@ -41,6 +41,7 @@ use pocketmine\entity\Villager;
|
||||
use pocketmine\entity\Zombie;
|
||||
use pocketmine\inventory\ArmorInventory;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\nbt\NbtException;
|
||||
use pocketmine\nbt\tag\CompoundTag;
|
||||
use pocketmine\utils\SingletonTrait;
|
||||
use pocketmine\world\World;
|
||||
@@ -444,6 +445,7 @@ class ItemFactory{
|
||||
* Deserializes an item from the provided legacy ID, legacy meta, count and NBT.
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @throws NbtException
|
||||
*/
|
||||
public function get(int $id, int $meta = 0, int $count = 1, ?CompoundTag $tags = null) : Item{
|
||||
/** @var Item|null $item */
|
||||
|
Reference in New Issue
Block a user