Fixed spells never being able to activate

This commit is contained in:
Auxilor 2021-03-09 19:05:21 +00:00
parent 2ccb1efd73
commit 46542a5ce5

View File

@ -116,10 +116,6 @@ public abstract class Spell extends EcoEnchant {
return; return;
} }
if (!tracker.containsKey(player.getUniqueId())) {
tracker.put(player.getUniqueId(), System.currentTimeMillis() + (long) ((this.getCooldownTime() * 1000L) * Spell.getCooldownMultiplier(player)));
}
int cooldown = getCooldown(this, player); int cooldown = getCooldown(this, player);
if (event.getClickedBlock() != null) { if (event.getClickedBlock() != null) {
@ -140,6 +136,7 @@ public abstract class Spell extends EcoEnchant {
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_BASS, 1, 0.5f); player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_BASS, 1, 0.5f);
} else { } else {
tracker.remove(player.getUniqueId()); tracker.remove(player.getUniqueId());
tracker.put(player.getUniqueId(), System.currentTimeMillis() + (long) ((this.getCooldownTime() * 1000L) * Spell.getCooldownMultiplier(player)));
SpellActivateEvent spellActivateEvent = new SpellActivateEvent(player, this); SpellActivateEvent spellActivateEvent = new SpellActivateEvent(player, this);
Bukkit.getPluginManager().callEvent(spellActivateEvent); Bukkit.getPluginManager().callEvent(spellActivateEvent);