mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
Player now drops the contents of temporary inventories
these inventories are just glorified crafting tables.
This commit is contained in:
parent
3b103dcd62
commit
86c4e936cb
@ -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