Paper/CraftBukkit-Patches/0160-Don-t-Fire-InventoryCloseEvent-Unless-Required.patch
Zach Brown 06c1cf41ab Update Spigot's Patches
Fix Build 2339ac14a8e
Regen the patches 89d3fcbdfaf

This new system breaks a lot :(
2014-11-28 18:03:01 -06:00

22 lines
1009 B
Diff

From efa2b170f2ca3ca35c18bcbc906c68696aa6b3c1 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Tue, 30 Sep 2014 21:49:10 +1000
Subject: [PATCH] Don't Fire InventoryCloseEvent Unless Required
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 2f3ff86..5657e00 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -828,6 +828,7 @@ public class CraftEventFactory {
}
public static void handleInventoryCloseEvent(EntityHuman human) {
+ if (human.activeContainer == human.defaultContainer) return; // Spigot
InventoryCloseEvent event = new InventoryCloseEvent(human.activeContainer.getBukkitView());
human.world.getServer().getPluginManager().callEvent(event);
human.activeContainer.transferTo(human.defaultContainer, human.getBukkitEntity());
--
2.1.0