From 8356285b666cc2221c3dfb4e4f3d7268545ef093 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 14 Jun 2019 19:39:35 +0100 Subject: [PATCH] Consistently call InventoryCloseEvent this wasn't being fired when a plugin did the removal. --- src/pocketmine/Player.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index b6900e92c..c47959890 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -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]); }