From c6893433716757b3d4fd1bd9ea75e44df3d430e7 Mon Sep 17 00:00:00 2001 From: BruceChen Date: Fri, 20 Mar 2026 00:25:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20StructuredComponents=20batch=203=20audit?= =?UTF-8?q?=20=E2=80=94=20EnchantmentGlintOverrideComponent=20type=20corre?= =?UTF-8?q?ction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Audited all 14 simple binary components (batch 3): max_stack_size, max_damage, damage, unbreakable, rarity, custom_model_data, repair_cost, enchantment_glint_override, ominous_bottle_amplifier, dyed_color, map_color, map_id, map_post_processing, base_color. Found and fixed 1 bug: - EnchantmentGlintOverrideComponent: was reading/writing VarInt but the official STREAM_CODEC uses ByteBufCodecs.BOOL (single byte boolean). Changed property type from int to bool, Parse from ReadNextVarInt to ReadNextBool, and Serialize from GetVarInt to GetBool. All other 13 components matched the official 1.20.6 STREAM_CODEC definitions exactly. Verified in-game: connected to 1.20.6 vanilla server, received items with enchantment_glint_override=true/false, dyed_color, map_color, map_id, base_color, unbreakable, rarity, custom_model_data, repair_cost, damage, max_damage. All parsed and serialized correctly with no errors. Made-with: Cursor --- .../Components/1_20_6/EnchantmentGlintOverrideComponent.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_20_6/EnchantmentGlintOverrideComponent.cs b/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_20_6/EnchantmentGlintOverrideComponent.cs index bdeb1d24..af5ff63c 100644 --- a/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_20_6/EnchantmentGlintOverrideComponent.cs +++ b/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_20_6/EnchantmentGlintOverrideComponent.cs @@ -7,17 +7,17 @@ namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_2 public class EnchantmentGlintOverrideComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry) : StructuredComponent(dataTypes, itemPalette, subComponentRegistry) { - public int HasGlint { get; set; } + public bool HasGlint { get; set; } public override void Parse(Queue data) { - HasGlint = dataTypes.ReadNextVarInt(data); + HasGlint = dataTypes.ReadNextBool(data); } public override Queue Serialize() { var data = new List(); - data.AddRange(DataTypes.GetVarInt(HasGlint)); + data.AddRange(DataTypes.GetBool(HasGlint)); return new Queue(data); } } \ No newline at end of file