testserver/CraftBukkit-Patches/0154-Don-t-Fire-InventoryCl...

22 lines
1009 B
Diff
Raw Normal View History

2015-03-08 11:04:41 +00:00
From b380d4bfcb871cf8c761e4446e5f72fdfb7af0fa Mon Sep 17 00:00:00 2001
2014-11-28 01:17:45 +00:00
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
2015-02-28 11:36:22 +00:00
index ed762cd..fd20f9e 100644
2014-11-28 01:17:45 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -833,6 +833,7 @@ public class CraftEventFactory {
2014-11-28 01:17:45 +00:00
}
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