Correctly update action bits in PLAYER_INFO_UPDATE in 1.21.2->1.21 (#899)

This commit is contained in:
EnZaXD 2024-10-26 14:07:13 +02:00 committed by GitHub
parent 31d5a98f26
commit 927ffaf20a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -336,7 +336,16 @@ public final class EntityPacketRewriter1_21_2 extends EntityRewriter<Clientbound
}); });
protocol.registerClientbound(ClientboundPackets1_21_2.PLAYER_INFO_UPDATE, wrapper -> { protocol.registerClientbound(ClientboundPackets1_21_2.PLAYER_INFO_UPDATE, wrapper -> {
final BitSet actions = wrapper.passthroughAndMap(Types.PROFILE_ACTIONS_ENUM1_21_2, Types.PROFILE_ACTIONS_ENUM1_19_3); final BitSet actions = wrapper.read(Types.PROFILE_ACTIONS_ENUM1_21_2);
// We need to recreate the BitSet field itself to remove the new action
final BitSet updatedActions = new BitSet(6);
for (int i = 0; i < 6; i++) {
if (actions.get(i)) {
updatedActions.set(i);
}
}
wrapper.write(Types.PROFILE_ACTIONS_ENUM1_19_3, updatedActions);
final int entries = wrapper.passthrough(Types.VAR_INT); final int entries = wrapper.passthrough(Types.VAR_INT);
for (int i = 0; i < entries; i++) { for (int i = 0; i < entries; i++) {
wrapper.passthrough(Types.UUID); wrapper.passthrough(Types.UUID);

View File

@ -1,4 +1,4 @@
projectVersion=5.1.0 projectVersion=5.1.1-SNAPSHOT
# Smile emoji # Smile emoji
mcVersions=1.21.3,1.21.2,1.21.1,1.21,1.20.6,1.20.5,1.20.4, 1.20.3, 1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10 mcVersions=1.21.3,1.21.2,1.21.1,1.21,1.20.6,1.20.5,1.20.4, 1.20.3, 1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10