Add message to /mcscoreboard keep when a board is not shown

This commit is contained in:
riking 2013-10-25 11:39:24 -07:00
parent c6ca65f5c9
commit bd611ee11c
3 changed files with 11 additions and 4 deletions

View File

@ -35,6 +35,10 @@ public class McscoreboardCommand implements TabExecutor {
sender.sendMessage(LocaleLoader.getString("Commands.Disabled")); sender.sendMessage(LocaleLoader.getString("Commands.Disabled"));
return true; return true;
} }
if (!ScoreboardManager.isBoardShown(sender.getName())) {
sender.sendMessage(LocaleLoader.getString("Commands.Scoreboard.NoBoard"));
return true;
}
ScoreboardManager.keepBoard(sender.getName()); ScoreboardManager.keepBoard(sender.getName());
sender.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Keep")); sender.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Keep"));
} }

View File

@ -371,15 +371,17 @@ public class ScoreboardManager {
} }
} }
public static boolean isBoardShown(String playerName) {
return PLAYER_SCOREBOARDS.get(playerName).isBoardShown();
}
public static void clearBoard(String playerName) { public static void clearBoard(String playerName) {
PLAYER_SCOREBOARDS.get(playerName).tryRevertBoard(); PLAYER_SCOREBOARDS.get(playerName).tryRevertBoard();
} }
public static void keepBoard(String playerName) { public static void keepBoard(String playerName) {
if (Config.getInstance().getAllowKeepBoard()) {
PLAYER_SCOREBOARDS.get(playerName).cancelRevert(); PLAYER_SCOREBOARDS.get(playerName).cancelRevert();
} }
}
public static void setRevertTimer(String playerName, int seconds) { public static void setRevertTimer(String playerName, int seconds) {
PLAYER_SCOREBOARDS.get(playerName).showBoardAndScheduleRevert(seconds * Misc.TICK_CONVERSION_FACTOR);; PLAYER_SCOREBOARDS.get(playerName).showBoardAndScheduleRevert(seconds * Misc.TICK_CONVERSION_FACTOR);;

View File

@ -524,13 +524,14 @@ Commands.Reset.All=[[GREEN]]All of your skill levels have been reset successfull
Commands.Reset.Single=[[GREEN]]Your {0} skill level has been reset successfully. Commands.Reset.Single=[[GREEN]]Your {0} skill level has been reset successfully.
Commands.Reset=[[RED]]Reset a skill's level to 0 Commands.Reset=[[RED]]Reset a skill's level to 0
Commands.Scoreboard.Clear=[[DARK_AQUA]]mcMMO scoreboard cleared. Commands.Scoreboard.Clear=[[DARK_AQUA]]mcMMO scoreboard cleared.
Commands.Scoreboard.NoBoard=[[RED]]The mcMMO scoreboard is not active.
Commands.Scoreboard.Keep=[[DARK_AQUA]]The mcMMO scoreboard will stay up until you use [[GREEN]]/mcscoreboard clear[[DARK_AQUA]]. Commands.Scoreboard.Keep=[[DARK_AQUA]]The mcMMO scoreboard will stay up until you use [[GREEN]]/mcscoreboard clear[[DARK_AQUA]].
#Commands.Scoreboard.Timer=[[BLUE]]This scoreboard will remain visible for [[GOLD]]{1}[[BLUE]] seconds. #Commands.Scoreboard.Timer=[[BLUE]]This scoreboard will remain visible for [[GOLD]]{1}[[BLUE]] seconds.
Commands.Scoreboard.Help.0=[[GOLD]] == [[GREEN]]Help for [[RED]]/mcscoreboard[[GOLD]] == Commands.Scoreboard.Help.0=[[GOLD]] == [[GREEN]]Help for [[RED]]/mcscoreboard[[GOLD]] ==
Commands.Scoreboard.Help.1=[[DARK_AQUA]]/mcscoreboard[[AQUA]] clear [[WHITE]] - clear the McMMO scoreboard Commands.Scoreboard.Help.1=[[DARK_AQUA]]/mcscoreboard[[AQUA]] clear [[WHITE]] - clear the McMMO scoreboard
Commands.Scoreboard.Help.2=[[DARK_AQUA]]/mcscoreboard[[AQUA]] keep [[WHITE]] - keep the mcMMO scoreboard up Commands.Scoreboard.Help.2=[[DARK_AQUA]]/mcscoreboard[[AQUA]] keep [[WHITE]] - keep the mcMMO scoreboard up
Commands.Scoreboard.Help.3=[[DARK_AQUA]]/mcscoreboard[[AQUA]] time [n] [[WHITE]] - clear the McMMO scoreboard after [[LIGHT_PURPLE]]n[[WHITE]] seconds Commands.Scoreboard.Help.3=[[DARK_AQUA]]/mcscoreboard[[AQUA]] time [n] [[WHITE]] - clear the McMMO scoreboard after [[LIGHT_PURPLE]]n[[WHITE]] seconds
Commands.Scoreboard.Tip.Keep=[[GOLD]]Tip: Use [[RED]]/mcscoreboard keep[[GOLD]] to keep the scoreboard from going away. Commands.Scoreboard.Tip.Keep=[[GOLD]]Tip: Use [[RED]]/mcscoreboard keep[[GOLD]] while the scoreboard is shown to keep it from going away.
Commands.Scoreboard.Tip.Clear=[[GOLD]]Tip: Use [[RED]]/mcscoreboard clear[[GOLD]] to get rid of the scoreboard. Commands.Scoreboard.Tip.Clear=[[GOLD]]Tip: Use [[RED]]/mcscoreboard clear[[GOLD]] to get rid of the scoreboard.
Commands.Skill.Invalid=[[RED]]That is not a valid skillname! Commands.Skill.Invalid=[[RED]]That is not a valid skillname!
Commands.Skill.Leaderboard=[[YELLOW]]--mcMMO [[BLUE]]{0}[[YELLOW]] Leaderboard-- Commands.Skill.Leaderboard=[[YELLOW]]--mcMMO [[BLUE]]{0}[[YELLOW]] Leaderboard--