From b746d9df0b6b7765478b2a72c2d963b6e668fa35 Mon Sep 17 00:00:00 2001 From: brickmonster <92665597+brickmonster@users.noreply.github.com> Date: Wed, 11 Dec 2024 21:17:33 +0000 Subject: [PATCH] Add missing UPDATE_HAT and UPDATE_LIST_ORDER to some paper-added functions in ClientboundPlayerInfoUpdatePacket (#11731) --- .../0848-Add-Listing-API-for-Player.patch | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/patches/server/0848-Add-Listing-API-for-Player.patch b/patches/server/0848-Add-Listing-API-for-Player.patch index b23b4a4362..d68563ed38 100644 --- a/patches/server/0848-Add-Listing-API-for-Player.patch +++ b/patches/server/0848-Add-Listing-API-for-Player.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add Listing API for Player diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java -index 6bfb83434a184e6fdba932f692281f0303ada65f..e2541a3886504b143f858a4e75ac4746d4d39e28 100644 +index 6bfb83434a184e6fdba932f692281f0303ada65f..91e71d282855c472bf81ff97ae830e5321f69e66 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java @@ -38,6 +38,17 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet players) { EnumSet enumSet = EnumSet.of( -@@ -53,6 +64,28 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet players, ServerPlayer forPlayer) { -+ final EnumSet enumSet = EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, ClientboundPlayerInfoUpdatePacket.Action.INITIALIZE_CHAT, ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED, ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LATENCY, ClientboundPlayerInfoUpdatePacket.Action.UPDATE_DISPLAY_NAME); ++ final EnumSet enumSet = EnumSet.of( ++ ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, ++ ClientboundPlayerInfoUpdatePacket.Action.INITIALIZE_CHAT, ++ ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, ++ ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED, ++ ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LATENCY, ++ ClientboundPlayerInfoUpdatePacket.Action.UPDATE_DISPLAY_NAME, ++ ClientboundPlayerInfoUpdatePacket.Action.UPDATE_HAT, ++ ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LIST_ORDER ++ ); + final List entries = new java.util.ArrayList<>(players.size()); + final org.bukkit.craftbukkit.entity.CraftPlayer bukkitEntity = forPlayer.getBukkitEntity(); + for (final ServerPlayer player : players) { @@ -42,7 +51,16 @@ index 6bfb83434a184e6fdba932f692281f0303ada65f..e2541a3886504b143f858a4e75ac4746 + } + + public static ClientboundPlayerInfoUpdatePacket createSinglePlayerInitializing(ServerPlayer player, boolean listed) { -+ final EnumSet enumSet = EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, ClientboundPlayerInfoUpdatePacket.Action.INITIALIZE_CHAT, ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED, ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LATENCY, ClientboundPlayerInfoUpdatePacket.Action.UPDATE_DISPLAY_NAME); ++ final EnumSet enumSet = EnumSet.of( ++ ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, ++ ClientboundPlayerInfoUpdatePacket.Action.INITIALIZE_CHAT, ++ ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, ++ ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED, ++ ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LATENCY, ++ ClientboundPlayerInfoUpdatePacket.Action.UPDATE_DISPLAY_NAME, ++ ClientboundPlayerInfoUpdatePacket.Action.UPDATE_HAT, ++ ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LIST_ORDER ++ ); + final List entries = List.of(new Entry(player, listed)); + return new ClientboundPlayerInfoUpdatePacket(enumSet, entries); + } @@ -55,7 +73,7 @@ index 6bfb83434a184e6fdba932f692281f0303ada65f..e2541a3886504b143f858a4e75ac4746 private ClientboundPlayerInfoUpdatePacket(RegistryFriendlyByteBuf buf) { this.actions = buf.readEnumSet(ClientboundPlayerInfoUpdatePacket.Action.class); this.entries = buf.readList(buf2 -> { -@@ -165,10 +198,15 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet