2013-04-29 20:19:41 +02:00
|
|
|
package com.gmail.nossr50.runnables.skills;
|
|
|
|
|
2019-01-11 16:11:17 +01:00
|
|
|
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
2019-01-15 07:11:58 +01:00
|
|
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
2019-01-13 04:56:54 +01:00
|
|
|
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
|
|
|
import com.gmail.nossr50.util.player.NotificationManager;
|
2013-04-29 20:19:41 +02:00
|
|
|
import org.bukkit.scheduler.BukkitRunnable;
|
|
|
|
|
|
|
|
public class AbilityCooldownTask extends BukkitRunnable {
|
2020-07-13 20:39:03 +02:00
|
|
|
private final McMMOPlayer mcMMOPlayer;
|
|
|
|
private final SuperAbilityType ability;
|
2013-04-29 20:19:41 +02:00
|
|
|
|
2019-01-13 04:56:54 +01:00
|
|
|
public AbilityCooldownTask(McMMOPlayer mcMMOPlayer, SuperAbilityType ability) {
|
2013-04-29 20:19:41 +02:00
|
|
|
this.mcMMOPlayer = mcMMOPlayer;
|
|
|
|
this.ability = ability;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void run() {
|
2019-04-06 14:14:52 +02:00
|
|
|
if (!mcMMOPlayer.getPlayer().isOnline() || mcMMOPlayer.getAbilityInformed(ability)) {
|
2013-04-29 20:19:41 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
mcMMOPlayer.setAbilityInformed(ability, true);
|
2019-01-11 16:11:17 +01:00
|
|
|
|
2019-01-13 04:56:54 +01:00
|
|
|
NotificationManager.sendPlayerInformation(mcMMOPlayer.getPlayer(), NotificationType.ABILITY_REFRESHED, ability.getAbilityRefresh());
|
2019-01-11 16:11:17 +01:00
|
|
|
//mcMMOPlayer.getPlayer().sendMessage(ability.getAbilityRefresh());
|
2013-04-29 20:19:41 +02:00
|
|
|
}
|
|
|
|
}
|