Fix chat colors being sent raw in debug

This commit is contained in:
libraryaddict 2020-04-24 17:43:25 +12:00
parent 535946d95d
commit ab1a7bffe4
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4

View File

@ -67,7 +67,8 @@ public class LDScoreboard implements LDCommand {
if (team == null) { if (team == null) {
if (issuesFound++ < 5) { if (issuesFound++ < 5) {
sender.sendMessage("The player disguise " + ((PlayerDisguise) disguise).getName() + sender.sendMessage("The player disguise " +
((PlayerDisguise) disguise).getName().replace(ChatColor.COLOR_CHAR, '&') +
" is missing a scoreboard team '" + scoreboardName.getTeamName() + "' on " + " is missing a scoreboard team '" + scoreboardName.getTeamName() + "' on " +
player.getName() + " and possibly more players!"); player.getName() + " and possibly more players!");
} }
@ -78,17 +79,22 @@ public class LDScoreboard implements LDCommand {
if (!team.getPrefix().equals(scoreboardName.getPrefix()) || if (!team.getPrefix().equals(scoreboardName.getPrefix()) ||
!team.getSuffix().equals(scoreboardName.getSuffix())) { !team.getSuffix().equals(scoreboardName.getSuffix())) {
if (issuesFound++ < 5) { if (issuesFound++ < 5) {
sender.sendMessage("The player disguise " + ((PlayerDisguise) disguise).getName() + sender.sendMessage("The player disguise " +
((PlayerDisguise) disguise).getName().replace(ChatColor.COLOR_CHAR, '&') +
" on scoreboard team '" + scoreboardName.getTeamName() + "' on " + " on scoreboard team '" + scoreboardName.getTeamName() + "' on " +
player.getName() + " has an unexpected prefix/suffix of '" + team.getPrefix() + player.getName() + " has an unexpected prefix/suffix of '" +
"' & '" + team.getSuffix() + "'!"); team.getPrefix().replace(ChatColor.COLOR_CHAR, '&') + "' & '" +
team.getSuffix().replace(ChatColor.COLOR_CHAR, '&') + "'! Expected '" +
scoreboardName.getPrefix().replace(ChatColor.COLOR_CHAR, '&') + "' & '" +
scoreboardName.getSuffix().replace(ChatColor.COLOR_CHAR, '&') + "'");
} }
continue; continue;
} }
if (!team.hasEntry(scoreboardName.getPlayer())) { if (!team.hasEntry(scoreboardName.getPlayer())) {
if (issuesFound++ < 5) { if (issuesFound++ < 5) {
sender.sendMessage("The player disguise " + ((PlayerDisguise) disguise).getName() + sender.sendMessage("The player disguise " +
((PlayerDisguise) disguise).getName().replace(ChatColor.COLOR_CHAR, '&') +
" on scoreboard team '" + scoreboardName.getTeamName() + "' on " + " on scoreboard team '" + scoreboardName.getTeamName() + "' on " +
player.getName() + " does not have the player entry expected! Instead has '" + player.getName() + " does not have the player entry expected! Instead has '" +
StringUtils.join(team.getEntries(), ", ").replace(ChatColor.COLOR_CHAR, '&') + StringUtils.join(team.getEntries(), ", ").replace(ChatColor.COLOR_CHAR, '&') +