Append to an empty component instead of the prefix (#334)

This commit is contained in:
Chipmunk 2023-01-09 13:09:34 +00:00 committed by GitHub
parent b3555d92d8
commit 91481b94e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -92,10 +92,11 @@ public class PlayerPrefix implements Listener {
}
private static void onUpdate(Player player) throws IOException {
final Component prefix = getPrefix(player);
final Component displayName = player.displayName();
final Component component = Component.empty()
.append(getPrefix(player))
.append(player.displayName());
player.playerListName(prefix.append(displayName));
player.playerListName(component);
}
@EventHandler(priority = EventPriority.MONITOR)