From 70e1b5bd18d0b602324315fbadfbcea697e164ee Mon Sep 17 00:00:00 2001 From: Mgazul Date: Mon, 7 Oct 2024 21:37:33 +0800 Subject: [PATCH] Fix Inventory Close --- .../craftbukkit/v1_12_R1/event/CraftEventFactory.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/v1_12_R1/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/v1_12_R1/event/CraftEventFactory.java index c68c2bbac8..caf6f1c029 100644 --- a/src/main/java/org/bukkit/craftbukkit/v1_12_R1/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/v1_12_R1/event/CraftEventFactory.java @@ -1061,11 +1061,12 @@ public static void handleInventoryCloseEvent(EntityPlayer human) { InventoryCloseEvent event = new InventoryCloseEvent(human.openContainer.getBukkitView()); if (human.openContainer.getBukkitView() != null) { human.world.getServer().getPluginManager().callEvent(event); + if (human instanceof EntityPlayerMP) { + ((EntityPlayerMP) human).getBukkitEntity().updateInventory(); + } } human.openContainer.transferTo(human.inventoryContainer, human.getBukkitEntity()); - if (human instanceof EntityPlayerMP) { - ((EntityPlayerMP) human).getBukkitEntity().updateInventory(); - } + } public static void handleEditBookEvent(EntityPlayerMP player, ItemStack newBookItem) {