From 6d6bc3de760d01018c7a2c67391181a9b95bccb2 Mon Sep 17 00:00:00 2001 From: GJ <gjmcferrin@gmail.com> Date: Thu, 2 May 2013 07:16:07 -0400 Subject: [PATCH] Trim player names to 16 chars when needed. --- .../gmail/nossr50/util/scoreboards/ScoreboardManager.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java b/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java index f365f5752..a89f3853f 100644 --- a/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java +++ b/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java @@ -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); } }