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) {