From 1ca23390cca5d7b74e21123bd13edfd3b702331c Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Sat, 15 Nov 2014 05:04:48 -0600 Subject: [PATCH] Fix my derp --- .../nautilus/game/arcade/addons/CompassAddon.java | 2 +- .../game/arcade/managers/MiscManager.java | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/CompassAddon.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/CompassAddon.java index 61419d08b..391fa4e9f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/CompassAddon.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/CompassAddon.java @@ -277,7 +277,7 @@ public class CompassAddon extends MiniPlugin @EventHandler(priority = EventPriority.HIGH) public void onInventoryClick(InventoryClickEvent event) { - if (event.getClickedInventory() != null && event.getWhoClicked() != null && event.getWhoClicked().getGameMode() == GameMode.CREATIVE && event.getClickedInventory().getTitle().equals("Spectate Menu")) + if (event.getClickedInventory() != null && event.getWhoClicked() != null && event.getWhoClicked().getGameMode() == GameMode.CREATIVE && event.getClickedInventory().getTitle().equals("Spectator Menu")) { event.setCancelled(false); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/MiscManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/MiscManager.java index 43a93a6d2..c378beb54 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/MiscManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/MiscManager.java @@ -91,15 +91,18 @@ public class MiscManager implements Listener } } - @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + @EventHandler(priority = EventPriority.MONITOR) public void InventoryClickClose(InventoryClickEvent event) { - Player player = UtilPlayer.searchExact(event.getWhoClicked().getName()); - if (player == null) - return; + if (event.isCancelled()) + { + Player player = UtilPlayer.searchExact(event.getWhoClicked().getName()); + if (player == null) + return; - if (event.getClickedInventory().getViewers().contains(player)) - player.closeInventory(); + if (event.getClickedInventory().getViewers().contains(player)) + player.closeInventory(); + } } @EventHandler