Cleanup more of Riking's mess.

This commit is contained in:
GJ 2013-10-25 17:07:56 -04:00
parent b3415ee2f4
commit 134e0db2e9
3 changed files with 3 additions and 12 deletions

View File

@ -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());
}
}

View File

@ -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);
}

View File

@ -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()) {