Paper/CraftBukkit-Patches/0157-Don-t-Fire-InventoryCloseEvent-Unless-Required.patch
Zach Brown b360cf686f Update from upstream SpigotMC
eb39b4729ce
59b08be5833
a723278f74a
2015-01-04 20:01:24 -06:00

22 lines
1009 B
Diff

From 2a91a6fce8494fcdd6ea4b91c6c01eb557752558 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 f057a91..72baeba 100644
--- 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 {
}
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