Skip to content

Commit

Permalink
Correctly update action bits in PLAYER_INFO_UPDATE in 1.21.2->1.21 (#899
Browse files Browse the repository at this point in the history
)
  • Loading branch information
FlorianMichael authored Oct 26, 2024
1 parent 31d5a98 commit 927ffaf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,16 @@ public void register() {
});

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);
for (int i = 0; i < entries; i++) {
wrapper.passthrough(Types.UUID);
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 927ffaf

Please sign in to comment.