Append to an empty component instead of the prefix

This commit is contained in:
Chipmunk 2022-12-30 21:59:24 +00:00 committed by GitHub
parent b3555d92d8
commit 82ded9a95c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)