diff options
author | brickmonster <[email protected]> | 2024-12-11 21:17:33 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-12-11 22:17:33 +0100 |
commit | b746d9df0b6b7765478b2a72c2d963b6e668fa35 (patch) | |
tree | e6781141f7933e20de6137f25508de2301b556e8 | |
parent | 4803421326fca1ba974d52844d882d1912ad62a3 (diff) | |
download | Paper-b746d9df0b6b7765478b2a72c2d963b6e668fa35.tar.gz Paper-b746d9df0b6b7765478b2a72c2d963b6e668fa35.zip |
Add missing UPDATE_HAT and UPDATE_LIST_ORDER to some paper-added functions in ClientboundPlayerInfoUpdatePacket (#11731)
-rw-r--r-- | patches/server/0848-Add-Listing-API-for-Player.patch | 30 |
1 files 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<ClientGamePacke @@ -26,13 +26,22 @@ index 6bfb83434a184e6fdba932f692281f0303ada65f..e2541a3886504b143f858a4e75ac4746 public static ClientboundPlayerInfoUpdatePacket createPlayerInitializing(Collection<ServerPlayer> players) { EnumSet<ClientboundPlayerInfoUpdatePacket.Action> enumSet = EnumSet.of( -@@ -53,6 +64,28 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke +@@ -53,6 +64,46 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke return new ClientboundPlayerInfoUpdatePacket(enumSet, players); } + // Paper start - Add Listing API for Player + public static ClientboundPlayerInfoUpdatePacket createPlayerInitializing(Collection<ServerPlayer> players, ServerPlayer forPlayer) { -+ final EnumSet<ClientboundPlayerInfoUpdatePacket.Action> 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<ClientboundPlayerInfoUpdatePacket.Action> 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<ClientboundPlayerInfoUpdatePacket.Entry> 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<ClientboundPlayerInfoUpdatePacket.Action> 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<ClientboundPlayerInfoUpdatePacket.Action> 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<ClientboundPlayerInfoUpdatePacket.Entry> 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<ClientGamePacke +@@ -165,10 +216,15 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke @Nullable RemoteChatSession.Data chatSession ) { Entry(ServerPlayer player) { @@ -72,7 +90,7 @@ index 6bfb83434a184e6fdba932f692281f0303ada65f..e2541a3886504b143f858a4e75ac4746 player.connection.latency(), player.gameMode.getGameModeForPlayer(), player.getTabListDisplayName(), -@@ -177,6 +215,11 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke +@@ -177,6 +233,11 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke Optionull.map(player.getChatSession(), RemoteChatSession::asData) ); } |