diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-12-28 15:14:53 +0000 |
---|---|---|
committer | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-12-28 15:14:53 +0000 |
commit | 0a0d3aa5a7ff2a5c1dffd42723c8eb0a5bb05fa6 (patch) | |
tree | 364c6c316b8ab8cc4492d319a83987c801936673 /src/main/java | |
parent | 2d5a55b36973ada1e2dd73a99f95575728af9b80 (diff) | |
download | craftbukkit-0a0d3aa5a7ff2a5c1dffd42723c8eb0a5bb05fa6.tar craftbukkit-0a0d3aa5a7ff2a5c1dffd42723c8eb0a5bb05fa6.tar.gz craftbukkit-0a0d3aa5a7ff2a5c1dffd42723c8eb0a5bb05fa6.tar.lz craftbukkit-0a0d3aa5a7ff2a5c1dffd42723c8eb0a5bb05fa6.tar.xz craftbukkit-0a0d3aa5a7ff2a5c1dffd42723c8eb0a5bb05fa6.zip |
SPIGOT-287: Fire a cancelled inventory open event for locked chests
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 391e5b92..60e2a4f5 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -680,6 +680,10 @@ public class CraftEventFactory { } public static Container callInventoryOpenEvent(EntityPlayer player, Container container) { + return callInventoryOpenEvent(player, container, false); + } + + public static Container callInventoryOpenEvent(EntityPlayer player, Container container, boolean cancelled) { if (player.activeContainer != player.defaultContainer) { // fire INVENTORY_CLOSE if one already open player.playerConnection.a(new PacketPlayInCloseWindow(player.activeContainer.windowId)); } @@ -689,6 +693,7 @@ public class CraftEventFactory { player.activeContainer.transferTo(container, craftPlayer); InventoryOpenEvent event = new InventoryOpenEvent(container.getBukkitView()); + event.setCancelled(cancelled); server.getPluginManager().callEvent(event); if (event.isCancelled()) { |