mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09:44 +00:00
Consistently call InventoryCloseEvent
this wasn't being fired when a plugin did the removal.
This commit is contained in:
parent
f671f2ebfa
commit
8356285b66
@ -2744,7 +2744,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
||||
$this->doCloseInventory();
|
||||
|
||||
if(isset($this->windowIndex[$windowId])){
|
||||
(new InventoryCloseEvent($this->windowIndex[$windowId], $this))->call();
|
||||
$this->removeWindow($this->windowIndex[$windowId]);
|
||||
return true;
|
||||
}
|
||||
@ -2844,6 +2843,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
||||
|
||||
$networkId = $this->windows[$objectId] ?? null;
|
||||
if($networkId !== null){
|
||||
(new InventoryCloseEvent($inventory, $this))->call();
|
||||
$inventory->onClose($this);
|
||||
unset($this->windows[$objectId], $this->windowIndex[$networkId], $this->permanentWindows[$objectId]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user