mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 18:29:46 +00:00
Do not save empty inventory slots
This commit is contained in:
parent
c9cf3d5aa4
commit
34f833fa79
@ -443,7 +443,9 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
|||||||
$slotCount = $this->inventory->getSize() + $this->inventory->getHotbarSize();
|
$slotCount = $this->inventory->getSize() + $this->inventory->getHotbarSize();
|
||||||
for($slot = $this->inventory->getHotbarSize(); $slot < $slotCount; ++$slot){
|
for($slot = $this->inventory->getHotbarSize(); $slot < $slotCount; ++$slot){
|
||||||
$item = $this->inventory->getItem($slot - 9);
|
$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
|
//Armor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user