address github issue #299 (ignore offhand interact events thrown since Spigot 1.9)

This commit is contained in:
slipcor 2016-12-15 18:49:30 +01:00
parent 3b88b889d6
commit e6e4782de8

View File

@ -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;