From e6e4782de8e9223d1f5e53e1fa3eb59e66f200ca Mon Sep 17 00:00:00 2001 From: slipcor Date: Thu, 15 Dec 2016 18:49:30 +0100 Subject: [PATCH] address github issue #299 (ignore offhand interact events thrown since Spigot 1.9) --- .../com/garbagemule/MobArena/commands/setup/SetupCommand.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/garbagemule/MobArena/commands/setup/SetupCommand.java b/src/main/java/com/garbagemule/MobArena/commands/setup/SetupCommand.java index e78b78e..ba75c2e 100644 --- a/src/main/java/com/garbagemule/MobArena/commands/setup/SetupCommand.java +++ b/src/main/java/com/garbagemule/MobArena/commands/setup/SetupCommand.java @@ -24,6 +24,7 @@ import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.server.PluginDisableEvent; +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -254,6 +255,8 @@ public class SetupCommand implements Command, Listener { Player p = event.getPlayer(); if (!p.equals(player)) return; + if (event.getHand().equals(EquipmentSlot.OFF_HAND)) return; + ItemStack tool = p.getItemInHand(); if (!isTool(tool)) return;