mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-11 03:41:23 +01:00
Fixed dyamite triggering on air click
This commit is contained in:
parent
f3c2afadbe
commit
0a95a8dba5
@ -81,4 +81,9 @@ public class Dynamite extends Spell {
|
||||
|
||||
AnticheatManager.unexemptPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean requiresBlockClick() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user