From f9a73c38d84bdee16ecc841bedc47ac1769caf1c Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Thu, 27 Feb 2014 22:25:54 +0100 Subject: [PATCH] Step two --- .../java/com/gmail/nossr50/listeners/TagListener.java | 2 ++ .../nossr50/util/scoreboards/ScoreboardManager.java | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/listeners/TagListener.java b/src/main/java/com/gmail/nossr50/listeners/TagListener.java index 76fdb9dbf..1d4128f76 100644 --- a/src/main/java/com/gmail/nossr50/listeners/TagListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/TagListener.java @@ -8,6 +8,7 @@ import org.bukkit.event.Listener; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import org.kitteh.tag.AsyncPlayerReceiveNameTagEvent; @@ -32,6 +33,7 @@ public class TagListener implements Listener { if (colorlessTag.equals(player.getName()) && (mcMMOPlayer.getNameTag() == null || !mcMMOPlayer.getNameTag().equals(tag))) { mcMMOPlayer.setNameTag(tag); + ScoreboardManager.tagUpdate(player); } /* diff --git a/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java b/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java index e4c34e560..70ee5b08c 100644 --- a/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java +++ b/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java @@ -224,6 +224,15 @@ public class ScoreboardManager { } } + // Called by internal TagAPI event listener + public static void tagUpdate(Player player) { + String playerName = player.getName(); + + if (Config.getInstance().getPowerLevelTagsEnabled() && !dirtyPowerLevels.contains(playerName)) { + dirtyPowerLevels.add(playerName); + } + } + // **** Setup methods **** // public static void enablePlayerSkillScoreboard(Player player, SkillType skill) {