13
0
geforkt von Mirrors/Paper

Fix Player.setPlayerListOrder to send update to clients (#11729)

Dieser Commit ist enthalten in:
96DarkCode96 2024-12-11 19:29:51 +01:00
Ursprung ef4609df02
Commit 830f9b021c

Datei anzeigen

@ -0,0 +1,25 @@
From 0000000000000000000000000000000000000000 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
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -0,0 +0,0 @@ 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