From e45e27ba340e3de5246a63e3a0433715302aebea Mon Sep 17 00:00:00 2001 From: samczsun Date: Thu, 9 Mar 2017 19:38:29 -0500 Subject: [PATCH] PC-629 --- .../game/games/gladiators/hotbar/HotbarEditor.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/hotbar/HotbarEditor.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/hotbar/HotbarEditor.java index 88b9411c9..364028b29 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/hotbar/HotbarEditor.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/hotbar/HotbarEditor.java @@ -14,6 +14,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.inventory.Inventory; @@ -127,11 +128,24 @@ public class HotbarEditor extends MiniPlugin if (UtilItem.isSimilar(item, _item, UtilItem.ItemAttribute.NAME)) { + event.setCancelled(true); HotbarInventory.open(event.getPlayer(), this); } } } + @EventHandler + public void onInteract(PlayerInteractEntityEvent event) + { + ItemStack item = event.getPlayer().getItemInHand(); + + if (UtilItem.isSimilar(item, _item, UtilItem.ItemAttribute.NAME)) + { + event.setCancelled(true); + HotbarInventory.open(event.getPlayer(), this); + } + } + public Gladiators getHost() { return _host;