Trim player names to 16 chars when needed.

This commit is contained in:
GJ 2013-05-02 07:16:07 -04:00
parent 5c4c3cf59c
commit 6d6bc3de76

View File

@ -278,6 +278,10 @@ public class ScoreboardManager {
String playerName = stat.get(1);
playerName = (playerName.equals(player.getName()) ? ChatColor.GOLD : "") + playerName;
if (playerName.length() > 16) {
playerName = playerName.substring(0, 16);
}
objective.getScore(server.getOfflinePlayer(playerName)).setScore(Integer.valueOf(stat.get(0)));
}
}
@ -286,6 +290,10 @@ public class ScoreboardManager {
String playerName = stat.name;
playerName = (playerName.equals(player.getName()) ? ChatColor.GOLD : "") + playerName;
if (playerName.length() > 16) {
playerName = playerName.substring(0, 16);
}
objective.getScore(server.getOfflinePlayer(playerName)).setScore(stat.statVal);
}
}