mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 14:46:46 +01:00
Cleanup more of Riking's mess.
This commit is contained in:
parent
b3415ee2f4
commit
134e0db2e9
@ -6,21 +6,12 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
|
||||
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
|
||||
import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
|
||||
public class ScoreboardsListener implements Listener {
|
||||
private final mcMMO plugin;
|
||||
|
||||
public ScoreboardsListener(final mcMMO plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent e) {
|
||||
ScoreboardManager.setupPlayer(e.getPlayer());
|
||||
@ -43,6 +34,6 @@ public class ScoreboardsListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onAbility(McMMOPlayerAbilityActivateEvent e) {
|
||||
ScoreboardManager.cooldownUpdate(e.getPlayer(), e.getSkill(), SkillUtils.calculateTimeLeft(e.getAbility(), UserManager.getPlayer(e.getPlayer()).getProfile(), e.getPlayer()));
|
||||
ScoreboardManager.cooldownUpdate(e.getPlayer(), e.getSkill());
|
||||
}
|
||||
}
|
||||
|
@ -384,7 +384,7 @@ public class mcMMO extends JavaPlugin {
|
||||
pluginManager.registerEvents(new EntityListener(this), this);
|
||||
pluginManager.registerEvents(new InventoryListener(this), this);
|
||||
pluginManager.registerEvents(new SelfListener(), this);
|
||||
pluginManager.registerEvents(new ScoreboardsListener(this), this);
|
||||
pluginManager.registerEvents(new ScoreboardsListener(), this);
|
||||
pluginManager.registerEvents(new WorldListener(this), this);
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ public class ScoreboardManager {
|
||||
}
|
||||
|
||||
// Called by internal ability event listeners
|
||||
public static void cooldownUpdate(Player player, SkillType skill, int cooldownSeconds) {
|
||||
public static void cooldownUpdate(Player player, SkillType skill) {
|
||||
// Selfboards
|
||||
ScoreboardWrapper wrapper = PLAYER_SCOREBOARDS.get(player.getName());
|
||||
if ((wrapper.isCooldownScoreboard() || wrapper.isSkillScoreboard() && wrapper.targetSkill == skill) && wrapper.isBoardShown()) {
|
||||
|
Loading…
Reference in New Issue
Block a user