From e38b3f382404901aa9bdf9a052b84e239b3ee445 Mon Sep 17 00:00:00 2001 From: EnZaXD Date: Sat, 19 Oct 2024 11:45:51 +0200 Subject: [PATCH] Add new PROFILE_ACTIONS_ENUM type in Types for 1.21.2+ --- .../main/java/com/viaversion/viaversion/api/type/Types.java | 4 +++- .../v1_19_1to1_19_3/rewriter/EntityPacketRewriter1_19_3.java | 2 +- .../protocols/v1_20_2to1_20_3/Protocol1_20_2To1_20_3.java | 2 +- .../com/viaversion/viaversion/rewriter/ComponentRewriter.java | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/Types.java b/api/src/main/java/com/viaversion/viaversion/api/type/Types.java index 8d6a7068e..d77d3c1c3 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/Types.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/Types.java @@ -189,7 +189,9 @@ public final class Types { public static final Type OPTIONAL_PLAYER_MESSAGE_SIGNATURE = new PlayerMessageSignatureType.OptionalPlayerMessageSignatureType(); public static final Type PLAYER_MESSAGE_SIGNATURE_ARRAY = new ArrayType<>(PLAYER_MESSAGE_SIGNATURE); - public static final BitSetType PROFILE_ACTIONS_ENUM = new BitSetType(6); + public static final BitSetType PROFILE_ACTIONS_ENUM1_19_3 = new BitSetType(6); + public static final BitSetType PROFILE_ACTIONS_ENUM1_21_2 = new BitSetType(7); + public static final ByteArrayType SIGNATURE_BYTES = new ByteArrayType(256); public static final BitSetType ACKNOWLEDGED_BIT_SET = new BitSetType(20); public static final ByteArrayType.OptionalByteArrayType OPTIONAL_SIGNATURE_BYTES = new ByteArrayType.OptionalByteArrayType(256); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_1to1_19_3/rewriter/EntityPacketRewriter1_19_3.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_1to1_19_3/rewriter/EntityPacketRewriter1_19_3.java index cf62c501e..649e2639e 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_1to1_19_3/rewriter/EntityPacketRewriter1_19_3.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_1to1_19_3/rewriter/EntityPacketRewriter1_19_3.java @@ -116,7 +116,7 @@ public final class EntityPacketRewriter1_19_3 extends EntityRewriter { - final BitSet actions = wrapper.passthrough(Types.PROFILE_ACTIONS_ENUM); + final BitSet actions = wrapper.passthrough(Types.PROFILE_ACTIONS_ENUM1_19_3); final int entries = wrapper.passthrough(Types.VAR_INT); for (int i = 0; i < entries; i++) { wrapper.passthrough(Types.UUID); diff --git a/common/src/main/java/com/viaversion/viaversion/rewriter/ComponentRewriter.java b/common/src/main/java/com/viaversion/viaversion/rewriter/ComponentRewriter.java index 3f3abd8f4..1b304d952 100644 --- a/common/src/main/java/com/viaversion/viaversion/rewriter/ComponentRewriter.java +++ b/common/src/main/java/com/viaversion/viaversion/rewriter/ComponentRewriter.java @@ -142,7 +142,7 @@ public class ComponentRewriter implements com.v public void registerPlayerInfoUpdate1_20_3(final C packetType) { protocol.registerClientbound(packetType, wrapper -> { - final BitSet actions = wrapper.passthrough(Types.PROFILE_ACTIONS_ENUM); + final BitSet actions = wrapper.passthrough(Types.PROFILE_ACTIONS_ENUM1_19_3); if (!actions.get(5)) { // Update display name return; }