diff --git a/src/pocketmine/inventory/AnvilInventory.php b/src/pocketmine/inventory/AnvilInventory.php index 7d74fdc01..c13d87251 100644 --- a/src/pocketmine/inventory/AnvilInventory.php +++ b/src/pocketmine/inventory/AnvilInventory.php @@ -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(); } } diff --git a/src/pocketmine/inventory/EnchantInventory.php b/src/pocketmine/inventory/EnchantInventory.php index e6f9cf118..059b229b6 100644 --- a/src/pocketmine/inventory/EnchantInventory.php +++ b/src/pocketmine/inventory/EnchantInventory.php @@ -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(); } }