mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 23:37:45 +00:00
Don't barf on air itemstacks found on disk
closes #5143 this is caused by bugs in PM4, where it saved air itemstacks when it wasn't supposed to. These issues are now all addressed in PM5, since ItemSerializer won't accept air itemstacks.
This commit is contained in:
@@ -633,6 +633,9 @@ class Item implements \JsonSerializable{
|
||||
*/
|
||||
public static function nbtDeserialize(CompoundTag $tag) : Item{
|
||||
$itemData = GlobalItemDataHandlers::getUpgrader()->upgradeItemStackNbt($tag);
|
||||
if($itemData === null){
|
||||
return VanillaItems::AIR();
|
||||
}
|
||||
|
||||
try{
|
||||
return GlobalItemDataHandlers::getDeserializer()->deserializeStack($itemData);
|
||||
|
Reference in New Issue
Block a user