From 46542a5ce5e7ff56aea411fdef2579a2e8a37630 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Tue, 9 Mar 2021 19:05:21 +0000 Subject: [PATCH] Fixed spells never being able to activate --- .../com/willfp/ecoenchants/enchantments/itemtypes/Spell.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 b227875a..b9ddf3af 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 @@ -116,10 +116,6 @@ public abstract class Spell extends EcoEnchant { return; } - if (!tracker.containsKey(player.getUniqueId())) { - tracker.put(player.getUniqueId(), System.currentTimeMillis() + (long) ((this.getCooldownTime() * 1000L) * Spell.getCooldownMultiplier(player))); - } - int cooldown = getCooldown(this, player); 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); } else { tracker.remove(player.getUniqueId()); + tracker.put(player.getUniqueId(), System.currentTimeMillis() + (long) ((this.getCooldownTime() * 1000L) * Spell.getCooldownMultiplier(player))); SpellActivateEvent spellActivateEvent = new SpellActivateEvent(player, this); Bukkit.getPluginManager().callEvent(spellActivateEvent);