diff --git a/src/main/java/com/gmail/nossr50/runnables/SkillMonitor.java b/src/main/java/com/gmail/nossr50/runnables/SkillMonitor.java index 7f24cd3a8..8494a623e 100644 --- a/src/main/java/com/gmail/nossr50/runnables/SkillMonitor.java +++ b/src/main/java/com/gmail/nossr50/runnables/SkillMonitor.java @@ -38,7 +38,7 @@ public class SkillMonitor implements Runnable { */ for (AbilityType ability : AbilityType.values()) { if (ability.getCooldown() > 0 ) { - Skills.watchCooldown(player, PP, curTime, ability); + Skills.watchCooldown(player, PP, ability); } } } diff --git a/src/main/java/com/gmail/nossr50/util/Skills.java b/src/main/java/com/gmail/nossr50/util/Skills.java index 1d94f93ce..e2e6e140a 100644 --- a/src/main/java/com/gmail/nossr50/util/Skills.java +++ b/src/main/java/com/gmail/nossr50/util/Skills.java @@ -76,11 +76,10 @@ public class Skills { * * @param player The player to send a message to * @param PP The profile of the player - * @param curTime The current system time * @param ability The ability to watch cooldowns for */ - public static void watchCooldown(Player player, PlayerProfile PP, long curTime, AbilityType ability) { - if (!PP.getAbilityInformed(ability) && curTime - (PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR) >= (ability.getCooldown() * TIME_CONVERSION_FACTOR)) { + public static void watchCooldown(Player player, PlayerProfile PP, AbilityType ability) { + if (!PP.getAbilityInformed(ability) && cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) { PP.setAbilityInformed(ability, true); player.sendMessage(ability.getAbilityRefresh()); }