mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +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();
|
$this->doCloseInventory();
|
||||||
|
|
||||||
if(isset($this->windowIndex[$windowId])){
|
if(isset($this->windowIndex[$windowId])){
|
||||||
(new InventoryCloseEvent($this->windowIndex[$windowId], $this))->call();
|
|
||||||
$this->removeWindow($this->windowIndex[$windowId]);
|
$this->removeWindow($this->windowIndex[$windowId]);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -2844,6 +2843,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
|||||||
|
|
||||||
$networkId = $this->windows[$objectId] ?? null;
|
$networkId = $this->windows[$objectId] ?? null;
|
||||||
if($networkId !== null){
|
if($networkId !== null){
|
||||||
|
(new InventoryCloseEvent($inventory, $this))->call();
|
||||||
$inventory->onClose($this);
|
$inventory->onClose($this);
|
||||||
unset($this->windows[$objectId], $this->windowIndex[$networkId], $this->permanentWindows[$objectId]);
|
unset($this->windows[$objectId], $this->windowIndex[$networkId], $this->permanentWindows[$objectId]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user