diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/spell/Dynamite.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/spell/Dynamite.java index 31397ad7..38187432 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/spell/Dynamite.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/spell/Dynamite.java @@ -81,4 +81,9 @@ public class Dynamite extends Spell { AnticheatManager.unexemptPlayer(player); } + + @Override + protected boolean requiresBlockClick() { + return true; + } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/itemtypes/Spell.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/itemtypes/Spell.java index c3e788e0..01eec4c6 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/itemtypes/Spell.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/itemtypes/Spell.java @@ -92,10 +92,16 @@ public abstract class Spell extends EcoEnchant { if (!(event.getAction().equals(Action.LEFT_CLICK_AIR) || event.getAction().equals(Action.LEFT_CLICK_BLOCK))) { return; } + if (requiresBlockClick() && !event.getAction().equals(Action.LEFT_CLICK_BLOCK)) { + return; + } } else { if (!(event.getAction().equals(Action.RIGHT_CLICK_AIR) || event.getAction().equals(Action.RIGHT_CLICK_BLOCK))) { return; } + if (requiresBlockClick() && !event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) { + return; + } } if (!EnchantChecks.mainhand(player, this)) { @@ -140,6 +146,15 @@ public abstract class Spell extends EcoEnchant { runnable.run(); } + /** + * Get if the spell requires a block to be clicked to trigger the spell. + * + * @return If the spell requires a block to be clicked. + */ + protected boolean requiresBlockClick() { + return false; + } + /** * Actual spell-specific implementations; the functionality. *