Make the scoreboard header more aesthetic
This commit is contained in:
parent
9ee5527068
commit
9ac2d3452a
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -4,6 +4,7 @@ import mineplex.core.scoreboard.ScoreboardLine;
|
||||
|
||||
public enum HubScoreboardLine implements ScoreboardLine
|
||||
{
|
||||
START_EMPTY_SPACER,
|
||||
SERVER_TITLE,
|
||||
SERVER_NAME,
|
||||
SERVER_EMPTY_SPACER,
|
||||
|
Loading…
Reference in New Issue
Block a user