mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-23 02:35:25 +01:00
Trim scoreboard rows
This commit is contained in:
parent
bb37b142c8
commit
621c542d77
@ -113,6 +113,6 @@ class Board {
|
||||
prefixLine = ChatColor.translateAlternateColorCodes(ChatColor.COLOR_CHAR, prefixLine);
|
||||
suffixLine = ChatColor.translateAlternateColorCodes(ChatColor.COLOR_CHAR, lastColorCodes + suffixLine);
|
||||
}
|
||||
return new ScoreboardLine(prefixLine, suffixLine);
|
||||
return new ScoreboardLine(prefixLine, suffixLine, allowed_line_size);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,13 @@ class ScoreboardLine {
|
||||
private final String prefix;
|
||||
private final String suffix;
|
||||
|
||||
public ScoreboardLine(String prefix, String suffix) {
|
||||
public ScoreboardLine(String prefix, String suffix, int limit) {
|
||||
if(prefix.length() > limit) {
|
||||
prefix = prefix.substring(0, limit);
|
||||
}
|
||||
if(suffix.length() > limit) {
|
||||
suffix = suffix.substring(0, limit);
|
||||
}
|
||||
this.prefix = prefix;
|
||||
this.suffix = suffix;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user