mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
Player: call InventoryCloseEvent after doing the necessary business
closes #4626 this does change the behaviour of getCurrentWindow() during InventoryCloseEvent, but no one should be using that anyway, since InventoryCloseEvent->getInventory() exists.
This commit is contained in:
parent
02cf6ae46c
commit
1181b13b5d
@ -2502,14 +2502,14 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
public function removeCurrentWindow() : void{
|
||||
$this->doCloseInventory();
|
||||
if($this->currentWindow !== null){
|
||||
(new InventoryCloseEvent($this->currentWindow, $this))->call();
|
||||
|
||||
$currentWindow = $this->currentWindow;
|
||||
$this->logger->debug("Closing inventory " . get_class($this->currentWindow) . "#" . spl_object_id($this->currentWindow));
|
||||
$this->currentWindow->onClose($this);
|
||||
if(($inventoryManager = $this->getNetworkSession()->getInvManager()) !== null){
|
||||
$inventoryManager->onCurrentWindowRemove();
|
||||
}
|
||||
$this->currentWindow = null;
|
||||
(new InventoryCloseEvent($currentWindow, $this))->call();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user