Player now drops the contents of temporary inventories

these inventories are just glorified crafting tables.
This commit is contained in:
Dylan K. Taylor 2018-11-25 17:13:35 +00:00
parent 3b103dcd62
commit 86c4e936cb
2 changed files with 8 additions and 2 deletions

View File

@ -59,6 +59,9 @@ class AnvilInventory extends ContainerInventory{
public function onClose(Player $who) : void{
parent::onClose($who);
$this->dropContents($this->holder->getLevel(), $this->holder->add(0.5, 0.5, 0.5));
foreach($this->getContents() as $item){
$who->dropItem($item);
}
$this->clearAll();
}
}

View File

@ -59,6 +59,9 @@ class EnchantInventory extends ContainerInventory{
public function onClose(Player $who) : void{
parent::onClose($who);
$this->dropContents($this->holder->getLevel(), $this->holder->add(0.5, 0.5, 0.5));
foreach($this->getContents() as $item){
$who->dropItem($item);
}
$this->clearAll();
}
}