From 2837612191e6fed5d047c78adbb01b31c479d003 Mon Sep 17 00:00:00 2001 From: 96DarkCode96 <96darkcode96@gmail.com> Date: Tue, 10 Dec 2024 15:45:47 +0100 Subject: [PATCH] Fix Player.setPlayerListOrder to send update to clients --- .../java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index d5dc10cf94..e9df37ff66 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -606,6 +606,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Preconditions.checkArgument(order >= 0, "order cannot be negative"); this.getHandle().listOrder = order; + // Paper start - Send update packet + if (getHandle().connection == null) return; // Updates are possible before the player has fully joined + for (ServerPlayer player : server.getHandle().players) { + if (player.getBukkitEntity().canSee(this)) { + player.connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LIST_ORDER, getHandle())); + } + } + // Paper end - Send update packet } private net.kyori.adventure.text.Component playerListHeader; // Paper - Adventure