2013-04-29 20:19:41 +02:00
|
|
|
package com.gmail.nossr50.runnables.skills;
|
|
|
|
|
2018-12-29 14:24:55 +01:00
|
|
|
import com.gmail.nossr50.datatypes.skills.SuperAbility;
|
2013-04-29 20:19:41 +02:00
|
|
|
import org.bukkit.scheduler.BukkitRunnable;
|
|
|
|
|
|
|
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
|
|
|
|
|
|
|
public class AbilityCooldownTask extends BukkitRunnable {
|
|
|
|
private McMMOPlayer mcMMOPlayer;
|
2018-12-29 14:24:55 +01:00
|
|
|
private SuperAbility ability;
|
2013-04-29 20:19:41 +02:00
|
|
|
|
2018-12-29 14:24:55 +01:00
|
|
|
public AbilityCooldownTask(McMMOPlayer mcMMOPlayer, SuperAbility ability) {
|
2013-04-29 20:19:41 +02:00
|
|
|
this.mcMMOPlayer = mcMMOPlayer;
|
|
|
|
this.ability = ability;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
if (mcMMOPlayer.getAbilityInformed(ability)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
mcMMOPlayer.setAbilityInformed(ability, true);
|
|
|
|
mcMMOPlayer.getPlayer().sendMessage(ability.getAbilityRefresh());
|
|
|
|
}
|
|
|
|
}
|