From 9ac2d3452a97cd555d18bdff81fdd6da8527aa5d Mon Sep 17 00:00:00 2001 From: Dan Mulloy Date: Tue, 5 Jun 2018 12:11:01 -0400 Subject: [PATCH] Make the scoreboard header more aesthetic --- .../src/mineplex/hub/HubClient.java | 24 +++++++++---------- .../hub/scoreboard/HubScoreboard.java | 4 +++- .../hub/scoreboard/HubScoreboardLine.java | 1 + 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java index acdcade2c..80ba56b4c 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java @@ -6,11 +6,10 @@ import mineplex.core.common.util.UtilText; public class HubClient { - private static final int DISPLAY_LENGTH = 16; - private String ScoreboardString; - private int ScoreboardIndex; + private String _display; + private int _index; public HubClient(String name) { @@ -19,30 +18,29 @@ public class HubClient public void setName(String name) { - // TODO temporary until I figure out what's wrong with scoreboards on 1.13 - // ScoreboardString = " Welcome " + name + ", to the Mineplex Network!"; - // ScoreboardIndex = 0; - ScoreboardString = UtilText.center(C.cGoldB + "MINE" + C.cDGrayB + "PLEX", LineFormat.SCOREBOARD); + //_display = " Welcome " + name + ", to the Mineplex Network!"; + //_index = 0; + _display = UtilText.center(C.cGoldB + "MINE" + C.cYellowB + "PLEX", LineFormat.SCOREBOARD); } public String GetScoreboardText() { - /* if (ScoreboardString.length() <= DISPLAY_LENGTH) + /* if (_display.length() <= DISPLAY_LENGTH) { - return ScoreboardString; + return _display; } - String display = ScoreboardString.substring(ScoreboardIndex, Math.min(ScoreboardIndex + DISPLAY_LENGTH, ScoreboardString.length())); + String display = _display.substring(_index, Math.min(_index + DISPLAY_LENGTH, _display.length())); if (display.length() < DISPLAY_LENGTH) { int add = DISPLAY_LENGTH - display.length(); - display += ScoreboardString.substring(0, add); + display += _display.substring(0, add); } - ScoreboardIndex = (ScoreboardIndex + 1) % ScoreboardString.length(); + _index = (_index + 1) % _display.length(); return display; */ - return ScoreboardString; + return _display; } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/scoreboard/HubScoreboard.java b/Plugins/Mineplex.Hub/src/mineplex/hub/scoreboard/HubScoreboard.java index 0b9e0ee4a..6385e5fd6 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/scoreboard/HubScoreboard.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/scoreboard/HubScoreboard.java @@ -47,7 +47,9 @@ public class HubScoreboard extends ScoreboardManager } } - scoreboard.register(HubScoreboardLine.SERVER_TITLE) + scoreboard + .register(HubScoreboardLine.START_EMPTY_SPACER) + .register(HubScoreboardLine.SERVER_TITLE) .register(HubScoreboardLine.SERVER_NAME) .register(HubScoreboardLine.SERVER_EMPTY_SPACER) .register(HubScoreboardLine.GEM_TITLE) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/scoreboard/HubScoreboardLine.java b/Plugins/Mineplex.Hub/src/mineplex/hub/scoreboard/HubScoreboardLine.java index fcf0acaf7..91bb94bff 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/scoreboard/HubScoreboardLine.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/scoreboard/HubScoreboardLine.java @@ -4,6 +4,7 @@ import mineplex.core.scoreboard.ScoreboardLine; public enum HubScoreboardLine implements ScoreboardLine { + START_EMPTY_SPACER, SERVER_TITLE, SERVER_NAME, SERVER_EMPTY_SPACER,