From 868bc773a10812abe867020f81236aab06ef0a51 Mon Sep 17 00:00:00 2001 From: tahmid-23 <60953955+tahmid-23@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:09:20 -0500 Subject: [PATCH] add missing PlayerAuthInputData, use zeroed BigInteger while writing large VarInt (#269) --- .../protocol/bedrock/codec/v766/BedrockCodecHelper_v766.java | 2 +- .../protocol/bedrock/data/PlayerAuthInputData.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v766/BedrockCodecHelper_v766.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v766/BedrockCodecHelper_v766.java index 31e3bb56..d8f3616c 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v766/BedrockCodecHelper_v766.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v766/BedrockCodecHelper_v766.java @@ -34,7 +34,7 @@ public > void readLargeVarIntFlags(ByteBuf buffer, Set flag @Override public > void writeLargeVarIntFlags(ByteBuf buffer, Set flags, Class clazz) { - BigInteger flagsInt = new BigInteger(clazz.getEnumConstants().length, ThreadLocalRandom.current()); + BigInteger flagsInt = BigInteger.ZERO; for (T flag : flags) { flagsInt = flagsInt.setBit(flag.ordinal()); } diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/data/PlayerAuthInputData.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/data/PlayerAuthInputData.java index 137a28e3..a150994a 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/data/PlayerAuthInputData.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/data/PlayerAuthInputData.java @@ -125,6 +125,10 @@ public enum PlayerAuthInputData { * @since v748 */ STOP_SPIN_ATTACK, + /** + * @since v766 + */ + HOTBAR_ONLY_TOUCH, /** * @since v766 */