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:
parent
00393ea4c2
commit
5a651d3cc7
@ -157,8 +157,8 @@ public class SignUtil {
|
|||||||
break;
|
break;
|
||||||
String PlayerName = PlayerList.get(i + number).getPlayerName();
|
String PlayerName = PlayerList.get(i + number).getPlayerName();
|
||||||
|
|
||||||
if (PlayerName != null && PlayerName.length() > 8) {
|
if (PlayerName != null && PlayerName.length() > 15) {
|
||||||
String PlayerNameStrip = PlayerName.split("(?<=\\G.{7})")[0];
|
String PlayerNameStrip = PlayerName.split("(?<=\\G.{15})")[0];
|
||||||
PlayerName = PlayerNameStrip + "~";
|
PlayerName = PlayerNameStrip + "~";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,10 +181,14 @@ public class SignUtil {
|
|||||||
|
|
||||||
TopList pl = PlayerList.get(one.getNumber() - 1);
|
TopList pl = PlayerList.get(one.getNumber() - 1);
|
||||||
String PlayerName = pl.getPlayerName();
|
String PlayerName = pl.getPlayerName();
|
||||||
if (PlayerName.length() > 8) {
|
if (PlayerName != null && PlayerName.length() > 15) {
|
||||||
String PlayerNameStrip = PlayerName.split("(?<=\\G.{7})")[0];
|
String PlayerNameStrip = PlayerName.split("(?<=\\G.{15})")[0];
|
||||||
PlayerName = PlayerNameStrip + "~";
|
PlayerName = PlayerNameStrip + "~";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (PlayerName == null)
|
||||||
|
PlayerName = "Unknown";
|
||||||
|
|
||||||
String line1 = Jobs.getLanguage().getMessage("signs.SpecialList.p" + one.getNumber(),
|
String line1 = Jobs.getLanguage().getMessage("signs.SpecialList.p" + one.getNumber(),
|
||||||
"[number]", one.getNumber() + number + 1,
|
"[number]", one.getNumber() + number + 1,
|
||||||
"[player]", PlayerName,
|
"[player]", PlayerName,
|
||||||
|
Loading…
Reference in New Issue
Block a user