mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 23:29:54 +00:00
Call InventoryCloseEvent in Player::removeWindow() (#4142)
closes #4130
This commit is contained in:
parent
21378b7f27
commit
a45a4a91ae
@ -3112,7 +3112,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
}
|
}
|
||||||
if(isset($this->windowIndex[$packet->windowId])){
|
if(isset($this->windowIndex[$packet->windowId])){
|
||||||
$this->closingWindowId = $packet->windowId;
|
$this->closingWindowId = $packet->windowId;
|
||||||
(new InventoryCloseEvent($this->windowIndex[$packet->windowId], $this))->call();
|
|
||||||
$this->removeWindow($this->windowIndex[$packet->windowId]);
|
$this->removeWindow($this->windowIndex[$packet->windowId]);
|
||||||
$this->closingWindowId = null;
|
$this->closingWindowId = null;
|
||||||
//removeWindow handles sending the appropriate
|
//removeWindow handles sending the appropriate
|
||||||
@ -4136,6 +4135,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($id !== null){
|
if($id !== null){
|
||||||
|
(new InventoryCloseEvent($inventory, $this))->call();
|
||||||
$inventory->close($this);
|
$inventory->close($this);
|
||||||
unset($this->windows[$hash], $this->windowIndex[$id], $this->permanentWindows[$id]);
|
unset($this->windows[$hash], $this->windowIndex[$id], $this->permanentWindows[$id]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user