Fixed armor not dropping (#1962)

This commit is contained in:
Muqsit 2018-01-25 00:01:32 +04:00 committed by Dylan K. Taylor
parent 4a4900e5e7
commit 6c71b443e8
2 changed files with 7 additions and 1 deletions

View File

@ -3549,6 +3549,9 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->inventory->setHeldItemIndex(0, false); //This is already handled when sending contents, don't send it twice
$this->inventory->clearAll();
}
if($this->armorInventory !== null){
$this->armorInventory->clearAll();
}
}
if($ev->getDeathMessage() != ""){

View File

@ -613,7 +613,10 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
}
public function getDrops() : array{
return $this->inventory !== null ? array_values($this->inventory->getContents()) : [];
return array_merge(
$this->inventory !== null ? array_values($this->inventory->getContents()) : [],
$this->armorInventory !== null ? array_values($this->armorInventory->getContents()) : []
);
}
public function saveNBT(){