mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Cleanup cooldown monitoring a bit.
This commit is contained in:
parent
2559ea61d8
commit
61205989cc
@ -38,7 +38,7 @@ public class SkillMonitor implements Runnable {
|
|||||||
*/
|
*/
|
||||||
for (AbilityType ability : AbilityType.values()) {
|
for (AbilityType ability : AbilityType.values()) {
|
||||||
if (ability.getCooldown() > 0 ) {
|
if (ability.getCooldown() > 0 ) {
|
||||||
Skills.watchCooldown(player, PP, curTime, ability);
|
Skills.watchCooldown(player, PP, ability);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,11 +76,10 @@ public class Skills {
|
|||||||
*
|
*
|
||||||
* @param player The player to send a message to
|
* @param player The player to send a message to
|
||||||
* @param PP The profile of the player
|
* @param PP The profile of the player
|
||||||
* @param curTime The current system time
|
|
||||||
* @param ability The ability to watch cooldowns for
|
* @param ability The ability to watch cooldowns for
|
||||||
*/
|
*/
|
||||||
public static void watchCooldown(Player player, PlayerProfile PP, long curTime, AbilityType ability) {
|
public static void watchCooldown(Player player, PlayerProfile PP, AbilityType ability) {
|
||||||
if (!PP.getAbilityInformed(ability) && curTime - (PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR) >= (ability.getCooldown() * TIME_CONVERSION_FACTOR)) {
|
if (!PP.getAbilityInformed(ability) && cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) {
|
||||||
PP.setAbilityInformed(ability, true);
|
PP.setAbilityInformed(ability, true);
|
||||||
player.sendMessage(ability.getAbilityRefresh());
|
player.sendMessage(ability.getAbilityRefresh());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user