From 927ffaf20a06e1fe2419aa1fe17e5e7c91dccb00 Mon Sep 17 00:00:00 2001 From: EnZaXD Date: Sat, 26 Oct 2024 14:07:13 +0200 Subject: [PATCH] Correctly update action bits in PLAYER_INFO_UPDATE in 1.21.2->1.21 (#899) --- .../rewriter/EntityPacketRewriter1_21_2.java | 11 ++++++++++- gradle.properties | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/v1_21_2to1_21/rewriter/EntityPacketRewriter1_21_2.java b/common/src/main/java/com/viaversion/viabackwards/protocol/v1_21_2to1_21/rewriter/EntityPacketRewriter1_21_2.java index 57812113..7b62ea6c 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/v1_21_2to1_21/rewriter/EntityPacketRewriter1_21_2.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/v1_21_2to1_21/rewriter/EntityPacketRewriter1_21_2.java @@ -336,7 +336,16 @@ public final class EntityPacketRewriter1_21_2 extends EntityRewriter { - 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); for (int i = 0; i < entries; i++) { wrapper.passthrough(Types.UUID); diff --git a/gradle.properties b/gradle.properties index 3af05c37..a03f4081 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=5.1.0 +projectVersion=5.1.1-SNAPSHOT # 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