diff --git a/EpicHoppers-Plugin/src/main/java/com/songoda/epichoppers/listeners/InventoryListeners.java b/EpicHoppers-Plugin/src/main/java/com/songoda/epichoppers/listeners/InventoryListeners.java index abcd52b..91ab946 100644 --- a/EpicHoppers-Plugin/src/main/java/com/songoda/epichoppers/listeners/InventoryListeners.java +++ b/EpicHoppers-Plugin/src/main/java/com/songoda/epichoppers/listeners/InventoryListeners.java @@ -36,8 +36,6 @@ public class InventoryListeners implements Listener { Player player = (Player) event.getWhoClicked(); if (inv == null || event.getCurrentItem() == null) return; - if (event.getRawSlot() > event.getView().getTopInventory().getSize() - 1) return; - if (event.getCursor() != null && event.getCurrentItem() != null) { ItemStack c = event.getCursor(); ItemStack item = event.getCurrentItem(); @@ -54,6 +52,8 @@ public class InventoryListeners implements Listener { } } + if (event.getRawSlot() > event.getView().getTopInventory().getSize() - 1) return; + if (!event.getCurrentItem().hasItemMeta()) return; if (doFilter(event)) return; diff --git a/EpicHoppers-Plugin/src/main/java/com/songoda/epichoppers/utils/Methods.java b/EpicHoppers-Plugin/src/main/java/com/songoda/epichoppers/utils/Methods.java index c00bc9a..cfbebcc 100644 --- a/EpicHoppers-Plugin/src/main/java/com/songoda/epichoppers/utils/Methods.java +++ b/EpicHoppers-Plugin/src/main/java/com/songoda/epichoppers/utils/Methods.java @@ -16,6 +16,7 @@ public class Methods { try { if (p.getItemInHand().hasItemMeta() && p.getItemInHand().getType() != Material.AIR + && p.getItemInHand().getType() != Material.ENCHANTED_BOOK && p.getItemInHand().getItemMeta().hasLore()) { for (String str : p.getItemInHand().getItemMeta().getLore()) { if (str.equals(Arconix.pl().getApi().format().formatText("&7Sync Touch")) || str.equals(Arconix.pl().getApi().format().formatText("&aSync Touch"))) {