diff --git a/MinecraftClient/Mapping/EntityMetadataPalette.cs b/MinecraftClient/Mapping/EntityMetadataPalette.cs index 60acef8c..e4ec35e6 100644 --- a/MinecraftClient/Mapping/EntityMetadataPalette.cs +++ b/MinecraftClient/Mapping/EntityMetadataPalette.cs @@ -26,6 +26,7 @@ public abstract class EntityMetadataPalette <= Protocol18Handler.MC_1_21_4_Version => new EntityMetadataPalette1206(), // 1.20.6 - 1.21.4 <= Protocol18Handler.MC_1_21_7_Version => new EntityMetadataPalette1215(), // 1.21.5 - 1.21.8 <= Protocol18Handler.MC_1_21_9_Version => new EntityMetadataPalette1219(), // 1.21.9 - 1.21.10 + <= Protocol18Handler.MC_1_21_11_Version => new EntityMetadataPalette12111(), // 1.21.11 _ => throw new NotImplementedException() }; } diff --git a/MinecraftClient/Program.cs b/MinecraftClient/Program.cs index ee448708..ae518b78 100644 --- a/MinecraftClient/Program.cs +++ b/MinecraftClient/Program.cs @@ -46,7 +46,7 @@ namespace MinecraftClient public const string Version = MCHighestVersion; public const string MCLowestVersion = "1.4.6"; - public const string MCHighestVersion = "1.21.10"; + public const string MCHighestVersion = "1.21.11"; public static readonly string? BuildInfo = null; private static Tuple? offlinePrompt = null; diff --git a/MinecraftClient/Protocol/Handlers/DataTypes.cs b/MinecraftClient/Protocol/Handlers/DataTypes.cs index d669fc68..4b4f0488 100644 --- a/MinecraftClient/Protocol/Handlers/DataTypes.cs +++ b/MinecraftClient/Protocol/Handlers/DataTypes.cs @@ -932,6 +932,10 @@ namespace MinecraftClient.Protocol.Handlers case EntityMetaDataType.WeatheringCopperState: // Weathering Copper state (1.21.9+) value = ReadNextVarInt(cache); break; + case EntityMetaDataType.ZombieNautilusVariant: // ZombieNautilus Variant (1.21.11+) + case EntityMetaDataType.HumanoidArm: // Humanoid Arm (1.21.11+) + value = ReadNextVarInt(cache); + break; case EntityMetaDataType.ResolvableProfile: // ResolvableProfile (1.21.9+) ReadNextResolvableProfile(cache); break; diff --git a/MinecraftClient/Protocol/Handlers/PacketType18Handler.cs b/MinecraftClient/Protocol/Handlers/PacketType18Handler.cs index 6a608dba..d8e56c86 100644 --- a/MinecraftClient/Protocol/Handlers/PacketType18Handler.cs +++ b/MinecraftClient/Protocol/Handlers/PacketType18Handler.cs @@ -48,9 +48,9 @@ namespace MinecraftClient.Protocol.Handlers { PacketTypePalette p = protocol switch { - > Protocol18Handler.MC_1_21_9_Version => throw new NotImplementedException(Translations + > Protocol18Handler.MC_1_21_11_Version => throw new NotImplementedException(Translations .exception_palette_packet), - <= Protocol18Handler.MC_1_21_9_Version and > Protocol18Handler.MC_1_21_7_Version => new PacketPalette1219(), + <= Protocol18Handler.MC_1_21_11_Version and > Protocol18Handler.MC_1_21_7_Version => new PacketPalette1219(), <= Protocol18Handler.MC_1_21_7_Version and > Protocol18Handler.MC_1_21_5_Version => new PacketPalette1216(), <= Protocol18Handler.MC_1_21_5_Version and > Protocol18Handler.MC_1_21_4_Version => new PacketPalette1215(), <= Protocol18Handler.MC_1_21_4_Version and > Protocol18Handler.MC_1_21_2_Version => new PacketPalette1214(), diff --git a/MinecraftClient/Protocol/Handlers/Protocol18.cs b/MinecraftClient/Protocol/Handlers/Protocol18.cs index 6d102808..4fe6b857 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol18.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol18.cs @@ -79,6 +79,7 @@ namespace MinecraftClient.Protocol.Handlers internal const int MC_1_21_6_Version = 771; internal const int MC_1_21_7_Version = 772; internal const int MC_1_21_9_Version = 773; + internal const int MC_1_21_11_Version = 774; private int compression_treshold = -1; private int autocomplete_transaction_id = 0; @@ -130,21 +131,21 @@ namespace MinecraftClient.Protocol.Handlers lastSeenMessagesCollector = protocolVersion >= MC_1_19_3_Version ? new(20) : new(5); chunkBatchStartTime = GetNanos(); - if (handler.GetTerrainEnabled() && protocolVersion > MC_1_21_9_Version) + if (handler.GetTerrainEnabled() && protocolVersion > MC_1_21_11_Version) { log.Error($"§c{Translations.extra_terrainandmovement_disabled}"); handler.SetTerrainEnabled(false); } if (handler.GetInventoryEnabled() && - protocolVersion is < MC_1_8_Version or > MC_1_21_9_Version) + protocolVersion is < MC_1_8_Version or > MC_1_21_11_Version) { log.Error($"§c{Translations.extra_inventory_disabled}"); handler.SetInventoryEnabled(false); } if (handler.GetEntityHandlingEnabled() && - protocolVersion is < MC_1_8_Version or > MC_1_21_9_Version) + protocolVersion is < MC_1_8_Version or > MC_1_21_11_Version) { log.Error($"§c{Translations.extra_entity_disabled}"); handler.SetEntityHandlingEnabled(false); @@ -153,7 +154,7 @@ namespace MinecraftClient.Protocol.Handlers Block.Palette = protocolVersion switch { // Block palette - > MC_1_21_9_Version when handler.GetTerrainEnabled() => + > MC_1_21_11_Version when handler.GetTerrainEnabled() => throw new NotImplementedException(Translations.exception_palette_block), >= MC_1_21_9_Version => new Palette1219(), >= MC_1_21_6_Version => new Palette1216(), // 1.21.7/1.21.8 blocks unchanged, reuse 1216 @@ -177,8 +178,9 @@ namespace MinecraftClient.Protocol.Handlers entityPalette = protocolVersion switch { // Entity palette - > MC_1_21_9_Version when handler.GetEntityHandlingEnabled() => + > MC_1_21_11_Version when handler.GetEntityHandlingEnabled() => throw new NotImplementedException(Translations.exception_palette_entity), + >= MC_1_21_11_Version => new EntityPalette12111(), >= MC_1_21_9_Version => new EntityPalette1219(), >= MC_1_21_6_Version => new EntityPalette1216(), // 1.21.7/1.21.8 entities unchanged, reuse 1216 >= MC_1_21_5_Version => new EntityPalette1215(), @@ -205,8 +207,9 @@ namespace MinecraftClient.Protocol.Handlers itemPalette = protocolVersion switch { // Item palette - > MC_1_21_9_Version when handler.GetInventoryEnabled() => + > MC_1_21_11_Version when handler.GetInventoryEnabled() => throw new NotImplementedException(Translations.exception_palette_item), + >= MC_1_21_11_Version => new ItemPalette12111(), >= MC_1_21_9_Version => new ItemPalette1219(), >= MC_1_21_7_Version => new ItemPalette1217(), >= MC_1_21_6_Version => new ItemPalette1216(), @@ -2665,7 +2668,7 @@ namespace MinecraftClient.Protocol.Handlers // Also make a palette for field? Will be a lot of work var healthField = protocolVersion switch { - > MC_1_21_9_Version => throw new NotImplementedException(Translations + > MC_1_21_11_Version => throw new NotImplementedException(Translations .exception_palette_healthfield), // 1.17 and above >= MC_1_17_Version => 9, diff --git a/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/AttackRangeComponent.cs b/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/AttackRangeComponent.cs new file mode 100644 index 00000000..d4cc2dde --- /dev/null +++ b/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/AttackRangeComponent.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using MinecraftClient.Inventory.ItemPalettes; +using MinecraftClient.Protocol.Handlers.StructuredComponents.Core; + +namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_11; + +public class AttackRangeComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry) + : StructuredComponent(dataTypes, itemPalette, subComponentRegistry) +{ + public float MinRange { get; set; } + public float MaxRange { get; set; } + public float MinCreativeRange { get; set; } + public float MaxCreativeRange { get; set; } + public float HitboxMargin { get; set; } + public float MobFactor { get; set; } + + public override void Parse(Queue data) + { + MinRange = dataTypes.ReadNextFloat(data); + MaxRange = dataTypes.ReadNextFloat(data); + MinCreativeRange = dataTypes.ReadNextFloat(data); + MaxCreativeRange = dataTypes.ReadNextFloat(data); + HitboxMargin = dataTypes.ReadNextFloat(data); + MobFactor = dataTypes.ReadNextFloat(data); + } + + public override Queue Serialize() + { + var bytes = new List(); + bytes.AddRange(DataTypes.GetFloat(MinRange)); + bytes.AddRange(DataTypes.GetFloat(MaxRange)); + bytes.AddRange(DataTypes.GetFloat(MinCreativeRange)); + bytes.AddRange(DataTypes.GetFloat(MaxCreativeRange)); + bytes.AddRange(DataTypes.GetFloat(HitboxMargin)); + bytes.AddRange(DataTypes.GetFloat(MobFactor)); + return new Queue(bytes); + } +} diff --git a/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/KineticWeaponComponent.cs b/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/KineticWeaponComponent.cs new file mode 100644 index 00000000..1e1da338 --- /dev/null +++ b/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/KineticWeaponComponent.cs @@ -0,0 +1,47 @@ +using System.Collections.Generic; +using MinecraftClient.Inventory.ItemPalettes; +using MinecraftClient.Protocol.Handlers.StructuredComponents.Core; + +namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_11; + +public class KineticWeaponComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry) + : StructuredComponent(dataTypes, itemPalette, subComponentRegistry) +{ + public override void Parse(Queue data) + { + dataTypes.ReadNextVarInt(data); // contactCooldownTicks + dataTypes.ReadNextVarInt(data); // delayTicks + ReadOptionalCondition(data); // dismountConditions + ReadOptionalCondition(data); // knockbackConditions + ReadOptionalCondition(data); // damageConditions + dataTypes.ReadNextFloat(data); // forwardMovement + dataTypes.ReadNextFloat(data); // damageMultiplier + ReadOptionalSoundEventHolder(data); // sound + ReadOptionalSoundEventHolder(data); // hitSound + } + + private void ReadOptionalCondition(Queue data) + { + if (!dataTypes.ReadNextBool(data)) return; + dataTypes.ReadNextVarInt(data); // maxDurationTicks + dataTypes.ReadNextFloat(data); // minSpeed + dataTypes.ReadNextFloat(data); // minRelativeSpeed + } + + private void ReadOptionalSoundEventHolder(Queue data) + { + if (!dataTypes.ReadNextBool(data)) return; + var holderId = dataTypes.ReadNextVarInt(data); + if (holderId == 0) + { + dataTypes.ReadNextString(data); + if (dataTypes.ReadNextBool(data)) + dataTypes.ReadNextFloat(data); + } + } + + public override Queue Serialize() + { + return new Queue(); + } +} diff --git a/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/PiercingWeaponComponent.cs b/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/PiercingWeaponComponent.cs new file mode 100644 index 00000000..08646c66 --- /dev/null +++ b/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/PiercingWeaponComponent.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using MinecraftClient.Inventory.ItemPalettes; +using MinecraftClient.Protocol.Handlers.StructuredComponents.Core; + +namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_11; + +public class PiercingWeaponComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry) + : StructuredComponent(dataTypes, itemPalette, subComponentRegistry) +{ + public bool DealsKnockback { get; set; } + public bool Dismounts { get; set; } + + public override void Parse(Queue data) + { + DealsKnockback = dataTypes.ReadNextBool(data); + Dismounts = dataTypes.ReadNextBool(data); + ReadOptionalSoundEventHolder(data); + ReadOptionalSoundEventHolder(data); + } + + private void ReadOptionalSoundEventHolder(Queue data) + { + if (!dataTypes.ReadNextBool(data)) return; + var holderId = dataTypes.ReadNextVarInt(data); + if (holderId == 0) + { + dataTypes.ReadNextString(data); + if (dataTypes.ReadNextBool(data)) + dataTypes.ReadNextFloat(data); + } + } + + public override Queue Serialize() + { + return new Queue(); + } +} diff --git a/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/RegistryEitherHolderComponent.cs b/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/RegistryEitherHolderComponent.cs new file mode 100644 index 00000000..bba3d3c7 --- /dev/null +++ b/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/RegistryEitherHolderComponent.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using MinecraftClient.Inventory.ItemPalettes; +using MinecraftClient.Protocol.Handlers.StructuredComponents.Core; + +namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_11; + +/// +/// EitherHolder backed by holderRegistry (VarInt = raw registry ID, 0 is valid). +/// Used for DamageType and ZombieNautilusVariant where the holder codec is holderRegistry(), +/// unlike the holder() codec used in SoundEvent (where 0 means inline). +/// +public class RegistryEitherHolderComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry) + : StructuredComponent(dataTypes, itemPalette, subComponentRegistry) +{ + public bool IsHolder { get; set; } + public int HolderId { get; set; } + public string? ResourceKey { get; set; } + + public override void Parse(Queue data) + { + IsHolder = dataTypes.ReadNextBool(data); + if (IsHolder) + HolderId = dataTypes.ReadNextVarInt(data); + else + ResourceKey = dataTypes.ReadNextString(data); + } + + public override Queue Serialize() + { + var bytes = new List(); + bytes.AddRange(DataTypes.GetBool(IsHolder)); + if (IsHolder) + bytes.AddRange(DataTypes.GetVarInt(HolderId)); + else + bytes.AddRange(DataTypes.GetString(ResourceKey ?? "")); + return new Queue(bytes); + } +} diff --git a/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/SwingAnimationComponent.cs b/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/SwingAnimationComponent.cs new file mode 100644 index 00000000..7980f9f6 --- /dev/null +++ b/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/SwingAnimationComponent.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using MinecraftClient.Inventory.ItemPalettes; +using MinecraftClient.Protocol.Handlers.StructuredComponents.Core; + +namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_11; + +public class SwingAnimationComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry) + : StructuredComponent(dataTypes, itemPalette, subComponentRegistry) +{ + public int AnimationType { get; set; } + public int Duration { get; set; } + + public override void Parse(Queue data) + { + AnimationType = dataTypes.ReadNextVarInt(data); + Duration = dataTypes.ReadNextVarInt(data); + } + + public override Queue Serialize() + { + var bytes = new List(); + bytes.AddRange(DataTypes.GetVarInt(AnimationType)); + bytes.AddRange(DataTypes.GetVarInt(Duration)); + return new Queue(bytes); + } +} diff --git a/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/UseEffectsComponent.cs b/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/UseEffectsComponent.cs new file mode 100644 index 00000000..053e7d58 --- /dev/null +++ b/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/1_21_11/UseEffectsComponent.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using MinecraftClient.Inventory.ItemPalettes; +using MinecraftClient.Protocol.Handlers.StructuredComponents.Core; + +namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_11; + +public class UseEffectsComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry) + : StructuredComponent(dataTypes, itemPalette, subComponentRegistry) +{ + public bool CanSprint { get; set; } + public bool InteractVibrations { get; set; } + public float SpeedMultiplier { get; set; } + + public override void Parse(Queue data) + { + CanSprint = dataTypes.ReadNextBool(data); + InteractVibrations = dataTypes.ReadNextBool(data); + SpeedMultiplier = dataTypes.ReadNextFloat(data); + } + + public override Queue Serialize() + { + var bytes = new List(); + bytes.AddRange(DataTypes.GetBool(CanSprint)); + bytes.AddRange(DataTypes.GetBool(InteractVibrations)); + bytes.AddRange(DataTypes.GetFloat(SpeedMultiplier)); + return new Queue(bytes); + } +} diff --git a/MinecraftClient/Protocol/Handlers/StructuredComponents/Registries/StructuredComponentsRegistry12111.cs b/MinecraftClient/Protocol/Handlers/StructuredComponents/Registries/StructuredComponentsRegistry12111.cs new file mode 100644 index 00000000..ec848fb2 --- /dev/null +++ b/MinecraftClient/Protocol/Handlers/StructuredComponents/Registries/StructuredComponentsRegistry12111.cs @@ -0,0 +1,123 @@ +using MinecraftClient.Inventory.ItemPalettes; +using MinecraftClient.Protocol.Handlers.StructuredComponents.Components; +using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_20_6; +using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21; +using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_2; +using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_5; +using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_11; +using MinecraftClient.Protocol.Handlers.StructuredComponents.Core; + +namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Registries; + +public class StructuredComponentsRegistry12111 : StructuredComponentRegistry +{ + public StructuredComponentsRegistry12111(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry) + : base(dataTypes, itemPalette, subComponentRegistry) + { + RegisterComponent(0, "minecraft:custom_data"); + RegisterComponent(1, "minecraft:max_stack_size"); + RegisterComponent(2, "minecraft:max_damage"); + RegisterComponent(3, "minecraft:damage"); + RegisterComponent(4, "minecraft:unbreakable"); + RegisterComponent(5, "minecraft:use_effects"); + RegisterComponent(6, "minecraft:custom_name"); + RegisterComponent(7, "minecraft:minimum_attack_charge"); + RegisterComponent(8, "minecraft:damage_type"); + RegisterComponent(9, "minecraft:item_name"); + RegisterComponent(10, "minecraft:item_model"); + RegisterComponent(11, "minecraft:lore"); + RegisterComponent(12, "minecraft:rarity"); + RegisterComponent(13, "minecraft:enchantments"); + RegisterComponent(14, "minecraft:can_place_on"); + RegisterComponent(15, "minecraft:can_break"); + RegisterComponent(16, "minecraft:attribute_modifiers"); + RegisterComponent(17, "minecraft:custom_model_data"); + RegisterComponent(18, "minecraft:tooltip_display"); + RegisterComponent(19, "minecraft:repair_cost"); + RegisterComponent(20, "minecraft:creative_slot_lock"); + RegisterComponent(21, "minecraft:enchantment_glint_override"); + RegisterComponent(22, "minecraft:intangible_projectile"); + RegisterComponent(23, "minecraft:food"); + RegisterComponent(24, "minecraft:consumable"); + RegisterComponent(25, "minecraft:use_remainder"); + RegisterComponent(26, "minecraft:use_cooldown"); + RegisterComponent(27, "minecraft:damage_resistant"); + RegisterComponent(28, "minecraft:tool"); + RegisterComponent(29, "minecraft:weapon"); + RegisterComponent(30, "minecraft:attack_range"); + RegisterComponent(31, "minecraft:enchantable"); + RegisterComponent(32, "minecraft:equippable"); + RegisterComponent(33, "minecraft:repairable"); + RegisterComponent(34, "minecraft:glider"); + RegisterComponent(35, "minecraft:tooltip_style"); + RegisterComponent(36, "minecraft:death_protection"); + RegisterComponent(37, "minecraft:blocks_attacks"); + RegisterComponent(38, "minecraft:piercing_weapon"); + RegisterComponent(39, "minecraft:kinetic_weapon"); + RegisterComponent(40, "minecraft:swing_animation"); + RegisterComponent(41, "minecraft:stored_enchantments"); + RegisterComponent(42, "minecraft:dyed_color"); + RegisterComponent(43, "minecraft:map_color"); + RegisterComponent(44, "minecraft:map_id"); + RegisterComponent(45, "minecraft:map_decorations"); + RegisterComponent(46, "minecraft:map_post_processing"); + RegisterComponent(47, "minecraft:charged_projectiles"); + RegisterComponent(48, "minecraft:bundle_contents"); + RegisterComponent(49, "minecraft:potion_contents"); + RegisterComponent(50, "minecraft:potion_duration_scale"); + RegisterComponent(51, "minecraft:suspicious_stew_effects"); + RegisterComponent(52, "minecraft:writable_book_content"); + RegisterComponent(53, "minecraft:written_book_content"); + RegisterComponent(54, "minecraft:trim"); + RegisterComponent(55, "minecraft:debug_stick_state"); + RegisterComponent(56, "minecraft:entity_data"); + RegisterComponent(57, "minecraft:bucket_entity_data"); + RegisterComponent(58, "minecraft:block_entity_data"); + RegisterComponent(59, "minecraft:instrument"); + RegisterComponent(60, "minecraft:provides_trim_material"); + RegisterComponent(61, "minecraft:ominous_bottle_amplifier"); + RegisterComponent(62, "minecraft:jukebox_playable"); + RegisterComponent(63, "minecraft:provides_banner_patterns"); + RegisterComponent(64, "minecraft:recipes"); + RegisterComponent(65, "minecraft:lodestone_tracker"); + RegisterComponent(66, "minecraft:firework_explosion"); + RegisterComponent(67, "minecraft:fireworks"); + RegisterComponent(68, "minecraft:profile"); + RegisterComponent(69, "minecraft:note_block_sound"); + RegisterComponent(70, "minecraft:banner_patterns"); + RegisterComponent(71, "minecraft:base_color"); + RegisterComponent(72, "minecraft:pot_decorations"); + RegisterComponent(73, "minecraft:container"); + RegisterComponent(74, "minecraft:block_state"); + RegisterComponent(75, "minecraft:bees"); + RegisterComponent(76, "minecraft:lock"); + RegisterComponent(77, "minecraft:container_loot"); + + RegisterComponent(78, "minecraft:break_sound"); + RegisterComponent(79, "minecraft:villager/variant"); + RegisterComponent(80, "minecraft:wolf/variant"); + RegisterComponent(81, "minecraft:wolf/sound_variant"); + RegisterComponent(82, "minecraft:wolf/collar"); + RegisterComponent(83, "minecraft:fox/variant"); + RegisterComponent(84, "minecraft:salmon/size"); + RegisterComponent(85, "minecraft:parrot/variant"); + RegisterComponent(86, "minecraft:tropical_fish/pattern"); + RegisterComponent(87, "minecraft:tropical_fish/base_color"); + RegisterComponent(88, "minecraft:tropical_fish/pattern_color"); + RegisterComponent(89, "minecraft:mooshroom/variant"); + RegisterComponent(90, "minecraft:rabbit/variant"); + RegisterComponent(91, "minecraft:pig/variant"); + RegisterComponent(92, "minecraft:cow/variant"); + RegisterComponent(93, "minecraft:chicken/variant"); + RegisterComponent(94, "minecraft:zombie_nautilus/variant"); + RegisterComponent(95, "minecraft:frog/variant"); + RegisterComponent(96, "minecraft:horse/variant"); + RegisterComponent(97, "minecraft:painting/variant"); + RegisterComponent(98, "minecraft:llama/variant"); + RegisterComponent(99, "minecraft:axolotl/variant"); + RegisterComponent(100, "minecraft:cat/variant"); + RegisterComponent(101, "minecraft:cat/collar"); + RegisterComponent(102, "minecraft:sheep/color"); + RegisterComponent(103, "minecraft:shulker/color"); + } +} diff --git a/MinecraftClient/Protocol/Handlers/StructuredComponents/StructuredComponentsHandler.cs b/MinecraftClient/Protocol/Handlers/StructuredComponents/StructuredComponentsHandler.cs index 7274c319..c8b805c2 100644 --- a/MinecraftClient/Protocol/Handlers/StructuredComponents/StructuredComponentsHandler.cs +++ b/MinecraftClient/Protocol/Handlers/StructuredComponents/StructuredComponentsHandler.cs @@ -21,7 +21,6 @@ public class StructuredComponentsHandler { Protocol18Handler.MC_1_20_6_Version => typeof(SubComponentRegistry1206), Protocol18Handler.MC_1_21_Version => typeof(SubComponentRegistry121), - >= Protocol18Handler.MC_1_21_5_Version => typeof(SubComponentRegistry1212), >= Protocol18Handler.MC_1_21_2_Version => typeof(SubComponentRegistry1212), _ => throw new NotSupportedException($"Protocol version {protocolVersion} is not supported for subcomponent registries!") }; @@ -34,6 +33,7 @@ public class StructuredComponentsHandler { Protocol18Handler.MC_1_20_6_Version => typeof(StructuredComponentsRegistry1206), Protocol18Handler.MC_1_21_Version => typeof(StructuredComponentsRegistry121), + >= Protocol18Handler.MC_1_21_11_Version => typeof(StructuredComponentsRegistry12111), >= Protocol18Handler.MC_1_21_5_Version => typeof(StructuredComponentsRegistry1215), >= Protocol18Handler.MC_1_21_2_Version => typeof(StructuredComponentsRegistry1212), _ => throw new NotSupportedException($"Protocol version {protocolVersion} is not supported for structured component registries!") diff --git a/MinecraftClient/Protocol/ProtocolHandler.cs b/MinecraftClient/Protocol/ProtocolHandler.cs index a71b9122..fa1700cc 100644 --- a/MinecraftClient/Protocol/ProtocolHandler.cs +++ b/MinecraftClient/Protocol/ProtocolHandler.cs @@ -154,7 +154,7 @@ namespace MinecraftClient.Protocol { 4, 5, 47, 107, 108, 109, 110, 210, 315, 316, 335, 338, 340, 393, 401, 404, 477, 480, 485, 490, 498, 573, 575, 578, 735, 736, 751, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, - 769, 770, 771, 772, 773 + 769, 770, 771, 772, 773, 774 }; if (Array.IndexOf(suppoertedVersionsProtocol18, protocolVersion) > -1) @@ -368,6 +368,8 @@ namespace MinecraftClient.Protocol case "1.21.9": case "1.21.10": return 773; + case "1.21.11": + return 774; default: return 0; } @@ -455,6 +457,7 @@ namespace MinecraftClient.Protocol 771 => "1.21.6", 772 => "1.21.7", 773 => "1.21.9", + 774 => "1.21.11", _ => "0.0" }; }