1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-20 23:21:19 +01:00

Sign char limit is 16, #443

We do not need to short the player name to 8 character to look nicely on sign, for now if the name reach 15+ chars then write "~" after the name to short
This commit is contained in:
montlikadani 2019-06-01 23:40:55 +02:00
parent 00393ea4c2
commit 5a651d3cc7

View File

@ -157,8 +157,8 @@ public class SignUtil {
break;
String PlayerName = PlayerList.get(i + number).getPlayerName();
if (PlayerName != null && PlayerName.length() > 8) {
String PlayerNameStrip = PlayerName.split("(?<=\\G.{7})")[0];
if (PlayerName != null && PlayerName.length() > 15) {
String PlayerNameStrip = PlayerName.split("(?<=\\G.{15})")[0];
PlayerName = PlayerNameStrip + "~";
}
@ -181,10 +181,14 @@ public class SignUtil {
TopList pl = PlayerList.get(one.getNumber() - 1);
String PlayerName = pl.getPlayerName();
if (PlayerName.length() > 8) {
String PlayerNameStrip = PlayerName.split("(?<=\\G.{7})")[0];
if (PlayerName != null && PlayerName.length() > 15) {
String PlayerNameStrip = PlayerName.split("(?<=\\G.{15})")[0];
PlayerName = PlayerNameStrip + "~";
}
if (PlayerName == null)
PlayerName = "Unknown";
String line1 = Jobs.getLanguage().getMessage("signs.SpecialList.p" + one.getNumber(),
"[number]", one.getNumber() + number + 1,
"[player]", PlayerName,