Fix behaviour of /list when showing real names (#3858)

This commit is contained in:
triagonal 2021-01-01 11:14:39 +11:00 committed by GitHub
parent c6de77130f
commit b84aaa1dab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -37,7 +37,9 @@ public final class PlayerList {
}
user.setDisplayNick();
groupString.append(user.getDisplayName());
if (ess.getSettings().realNamesOnList() && !ChatColor.stripColor(user.getDisplayName()).equals(user.getName())) {
final String strippedNick = FormatUtil.stripFormat(user.getNickname());
if (ess.getSettings().realNamesOnList() && strippedNick != null && !strippedNick.equals(user.getName())) {
groupString.append(" (").append(user.getName()).append(")");
}
groupString.append(ChatColor.WHITE.toString());