mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 08:49:42 +00:00
Player now drops the contents of temporary inventories
these inventories are just glorified crafting tables.
This commit is contained in:
parent
a9a647855b
commit
8fe3f6ef1b
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user