mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Fixed #1889 Players drop their inventory when they die
This commit is contained in:
@ -80,6 +80,20 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
return $this->nameTag;
|
||||
}
|
||||
|
||||
public function getDrops(){
|
||||
$drops = [];
|
||||
if($this->inventory instanceof PlayerInventory){
|
||||
foreach($this->inventory->getContents() as $item){
|
||||
$drops[] = $item;
|
||||
}
|
||||
|
||||
foreach($this->inventory->getArmorContents() as $item){
|
||||
$drops[] = $item;
|
||||
}
|
||||
}
|
||||
return $drops;
|
||||
}
|
||||
|
||||
public function saveNBT(){
|
||||
parent::saveNBT();
|
||||
$this->namedtag->Inventory = new Enum("Inventory", []);
|
||||
|
Reference in New Issue
Block a user