PaperSpigot-Parent/CraftBukkit-Patches/0159-Don-t-Fire-InventoryCloseEvent-Unless-Required.patch
Zach Brown 28414e7e28 Update from upstream SpigotMC
6669d6ecd2b
b2740df50bb
bf71dc61149
fba27a2ea80
92ee7e7f8ec
b28f0d3de23
4beb4ac3918
0ddb6f3dde8
afe301fe892
b8f6402bbbe
2014-12-07 13:26:30 -06:00

22 lines
1009 B
Diff

From 1cb3de476b6b443341ad6e39987df680888a55fc 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