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_8; using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_9; using MinecraftClient.Protocol.Handlers.StructuredComponents.Core; namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Registries; public class StructuredComponentsRegistry1215 : StructuredComponentRegistry { public StructuredComponentsRegistry1215(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry) : base(dataTypes, itemPalette, subComponentRegistry) { var uses1218AttributeAndEquippableFormats = dataTypes.ProtocolVersion >= Protocol18Handler.MC_1_21_6_Version; var usesTypedBeesFormat = dataTypes.ProtocolVersion >= Protocol18Handler.MC_1_21_9_Version; RegisterComponent(0, "minecraft:custom_data"); RegisterComponent(1, "minecraft:max_stack_size"); RegisterComponent(2, "minecraft:max_damage"); RegisterComponent(3, "minecraft:damage"); RegisterComponent(4, "minecraft:unbreakable"); // Changed from Unbreakable (Bool) to Unit (empty) in 1.21.5 RegisterComponent(5, "minecraft:custom_name"); RegisterComponent(6, "minecraft:item_name"); RegisterComponent(7, "minecraft:item_model"); RegisterComponent(8, "minecraft:lore"); RegisterComponent(9, "minecraft:rarity"); RegisterComponent(10, "minecraft:enchantments"); RegisterComponent(11, "minecraft:can_place_on"); RegisterComponent(12, "minecraft:can_break"); if (uses1218AttributeAndEquippableFormats) RegisterComponent(13, "minecraft:attribute_modifiers"); else RegisterComponent(13, "minecraft:attribute_modifiers"); RegisterComponent(14, "minecraft:custom_model_data"); // 15: tooltip_display (NEW, replaces hide_additional_tooltip + hide_tooltip) RegisterComponent(15, "minecraft:tooltip_display"); RegisterComponent(16, "minecraft:repair_cost"); RegisterComponent(17, "minecraft:creative_slot_lock"); RegisterComponent(18, "minecraft:enchantment_glint_override"); RegisterComponent(19, "minecraft:intangible_projectile"); RegisterComponent(20, "minecraft:food"); RegisterComponent(21, "minecraft:consumable"); RegisterComponent(22, "minecraft:use_remainder"); RegisterComponent(23, "minecraft:use_cooldown"); RegisterComponent(24, "minecraft:damage_resistant"); RegisterComponent(25, "minecraft:tool"); RegisterComponent(26, "minecraft:weapon"); // NEW RegisterComponent(27, "minecraft:enchantable"); if (uses1218AttributeAndEquippableFormats) RegisterComponent(28, "minecraft:equippable"); else RegisterComponent(28, "minecraft:equippable"); RegisterComponent(29, "minecraft:repairable"); RegisterComponent(30, "minecraft:glider"); RegisterComponent(31, "minecraft:tooltip_style"); RegisterComponent(32, "minecraft:death_protection"); RegisterComponent(33, "minecraft:blocks_attacks"); // NEW RegisterComponent(34, "minecraft:stored_enchantments"); RegisterComponent(35, "minecraft:dyed_color"); RegisterComponent(36, "minecraft:map_color"); RegisterComponent(37, "minecraft:map_id"); RegisterComponent(38, "minecraft:map_decorations"); RegisterComponent(39, "minecraft:map_post_processing"); RegisterComponent(40, "minecraft:charged_projectiles"); RegisterComponent(41, "minecraft:bundle_contents"); RegisterComponent(42, "minecraft:potion_contents"); RegisterComponent(43, "minecraft:potion_duration_scale"); // NEW RegisterComponent(44, "minecraft:suspicious_stew_effects"); RegisterComponent(45, "minecraft:writable_book_content"); RegisterComponent(46, "minecraft:written_book_content"); RegisterComponent(47, "minecraft:trim"); RegisterComponent(48, "minecraft:debug_stick_state"); RegisterComponent(49, "minecraft:entity_data"); RegisterComponent(50, "minecraft:bucket_entity_data"); RegisterComponent(51, "minecraft:block_entity_data"); RegisterComponent(52, "minecraft:instrument"); // Changed to EitherHolder in 1.21.5 RegisterComponent(53, "minecraft:provides_trim_material"); // NEW RegisterComponent(54, "minecraft:ominous_bottle_amplifier"); RegisterComponent(55, "minecraft:jukebox_playable"); RegisterComponent(56, "minecraft:provides_banner_patterns"); // NEW RegisterComponent(57, "minecraft:recipes"); RegisterComponent(58, "minecraft:lodestone_tracker"); RegisterComponent(59, "minecraft:firework_explosion"); RegisterComponent(60, "minecraft:fireworks"); RegisterComponent(61, "minecraft:profile"); RegisterComponent(62, "minecraft:note_block_sound"); RegisterComponent(63, "minecraft:banner_patterns"); RegisterComponent(64, "minecraft:base_color"); RegisterComponent(65, "minecraft:pot_decorations"); RegisterComponent(66, "minecraft:container"); RegisterComponent(67, "minecraft:block_state"); if (usesTypedBeesFormat) RegisterComponent(68, "minecraft:bees"); else RegisterComponent(68, "minecraft:bees"); RegisterComponent(69, "minecraft:lock"); RegisterComponent(70, "minecraft:container_loot"); // Entity variant components (NEW in 1.21.5) RegisterComponent(71, "minecraft:break_sound"); RegisterComponent(72, "minecraft:villager/variant"); RegisterComponent(73, "minecraft:wolf/variant"); RegisterComponent(74, "minecraft:wolf/sound_variant"); RegisterComponent(75, "minecraft:wolf/collar"); // DyeColor as VarInt RegisterComponent(76, "minecraft:fox/variant"); RegisterComponent(77, "minecraft:salmon/size"); RegisterComponent(78, "minecraft:parrot/variant"); RegisterComponent(79, "minecraft:tropical_fish/pattern"); RegisterComponent(80, "minecraft:tropical_fish/base_color"); // DyeColor RegisterComponent(81, "minecraft:tropical_fish/pattern_color"); // DyeColor RegisterComponent(82, "minecraft:mooshroom/variant"); RegisterComponent(83, "minecraft:rabbit/variant"); RegisterComponent(84, "minecraft:pig/variant"); RegisterComponent(85, "minecraft:cow/variant"); RegisterComponent(86, "minecraft:chicken/variant"); // EitherHolder RegisterComponent(87, "minecraft:frog/variant"); RegisterComponent(88, "minecraft:horse/variant"); RegisterComponent(89, "minecraft:painting/variant"); // Holder RegisterComponent(90, "minecraft:llama/variant"); RegisterComponent(91, "minecraft:axolotl/variant"); RegisterComponent(92, "minecraft:cat/variant"); RegisterComponent(93, "minecraft:cat/collar"); // DyeColor RegisterComponent(94, "minecraft:sheep/color"); // DyeColor RegisterComponent(95, "minecraft:shulker/color"); // DyeColor } }