From 34f833fa79e048bcac4c52a0b8c9e936577f1490 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 25 Mar 2017 12:02:09 +0000 Subject: [PATCH] Do not save empty inventory slots --- src/pocketmine/entity/Human.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/entity/Human.php b/src/pocketmine/entity/Human.php index d9a26d1ee..e5c86b4b7 100644 --- a/src/pocketmine/entity/Human.php +++ b/src/pocketmine/entity/Human.php @@ -443,7 +443,9 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{ $slotCount = $this->inventory->getSize() + $this->inventory->getHotbarSize(); for($slot = $this->inventory->getHotbarSize(); $slot < $slotCount; ++$slot){ $item = $this->inventory->getItem($slot - 9); - $this->namedtag->Inventory[$slot] = $item->nbtSerialize($slot); + if($item->getId() !== ItemItem::AIR){ + $this->namedtag->Inventory[$slot] = $item->nbtSerialize($slot); + } } //Armor