From 91481b94e484af7ed7596992df26b6665fe9cda2 Mon Sep 17 00:00:00 2001 From: Chipmunk <65827213+ChipmunkMC@users.noreply.github.com> Date: Mon, 9 Jan 2023 13:09:34 +0000 Subject: [PATCH] Append to an empty component instead of the prefix (#334) --- .../java/pw/kaboom/extras/modules/player/PlayerPrefix.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/pw/kaboom/extras/modules/player/PlayerPrefix.java b/src/main/java/pw/kaboom/extras/modules/player/PlayerPrefix.java index b8ef1a1..ce35ed3 100644 --- a/src/main/java/pw/kaboom/extras/modules/player/PlayerPrefix.java +++ b/src/main/java/pw/kaboom/extras/modules/player/PlayerPrefix.java @@ -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)