diff --git a/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java b/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java index 385201cd9..75cae3f9f 100644 --- a/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java @@ -14,7 +14,6 @@ import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryCloseEvent; import org.bukkit.event.inventory.InventoryOpenEvent; import org.bukkit.event.inventory.InventoryType; -import org.bukkit.inventory.AnvilInventory; import org.bukkit.inventory.FurnaceInventory; import org.bukkit.inventory.ItemStack; @@ -134,8 +133,6 @@ public class InventoryListener implements Listener{ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onInventoryClickEvent(InventoryClickEvent event) { - if (event.getInventory() instanceof AnvilInventory) { - SkillTools.removeAbilityBuff(event.getCurrentItem()); - } + SkillTools.removeAbilityBuff(event.getCurrentItem()); } } diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 6b075c69d..a1e5d4449 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -146,7 +146,10 @@ public class PlayerListener implements Listener { if (playerProfile.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER) || playerProfile.getAbilityMode(AbilityType.SUPER_BREAKER)) { event.setCancelled(true); + return; } + + SkillTools.removeAbilityBuff(event.getItemDrop().getItemStack()); } /** diff --git a/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java b/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java index 5b6825123..d3203ba64 100644 --- a/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java +++ b/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java @@ -30,6 +30,7 @@ import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mods.ModChecks; import com.gmail.nossr50.spout.SpoutConfig; import com.gmail.nossr50.spout.SpoutTools; +import com.gmail.nossr50.util.ItemChecks; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.ParticleEffectUtils; import com.gmail.nossr50.util.Permissions; @@ -544,6 +545,10 @@ public class SkillTools { return item; } + if (!ItemChecks.isPickaxe(item) && !ItemChecks.isShovel(item)) { + return item; + } + if (item.containsEnchantment(Enchantment.DIG_SPEED)) { ItemMeta itemMeta = item.getItemMeta();