Minecraft-Console-Client/MinecraftClient/Inventory
BruceChen 79a0dff8cd Fix enchantment name display for 1.20.6 structured components
EnchantmentsComponent (used by both regular and stored enchantments)
was directly casting the registry VarInt ID to the Enchantments enum
via (Enchantments)id. However, the Enchantments enum is ordered
alphabetically (AquaAffinity=0, BaneOfArthropods=1, ..., Sharpness=32)
while the 1.20.6 registry uses a completely different order
(protection=0, fire_protection=1, ..., sharpness=13). This caused all
enchantment names to display incorrectly (e.g. Sharpness V shown as
"Unknown Enchantment with ID: 32").

Changes:
- Parse now uses EnchantmentMapping.GetEnchantmentByRegistryId1206()
  to properly map registry IDs to enum values via the existing
  1.20.6+ mapping table
- Serialize now uses EnchantmentMapping.GetRegistryId1206ByEnchantment()
  to convert enum values back to registry IDs (reverse lookup)
- Fixed translation key prefix: "Enchantments.minecraft." (wrong) ->
  "enchantment.minecraft." (matches en_us.json resource keys)
- Fixed 3 long-standing typos in the Enchantments enum that prevented
  translation lookup from matching resource keys:
  - DepthStrieder -> DepthStrider (depth_strieder vs depth_strider)
  - Efficency -> Efficiency (efficency vs efficiency)
  - Loyality -> Loyalty (loyality vs loyalty)

Verified on vanilla 1.20.6 server: items with sharpness, efficiency,
unbreaking, fortune, mending, and bane_of_arthropods all display
correct localized names (锋利, 效率, 耐久, 时运, 经验修补, 节肢杀手).

Made-with: Cursor
2026-03-19 02:01:15 +08:00
..
ItemPalettes Inventory, Terrain and Entity handling 2024-07-02 11:08:46 +02:00
BookPage.cs Added more structured components 2024-09-11 20:58:24 +02:00
Container.cs Added enchanting 2022-10-12 19:51:01 +02:00
ContainerExtensions.cs Added slab handling for 1.20/.1 2023-06-23 16:25:18 +02:00
ContainerType.cs Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00
ContainerTypeExtensions.cs Crowdin localization support (#2310) 2022-10-28 11:13:20 +08:00
Effects.cs [SKIP_BUILD] Change file encoding to UTF-8 with BOM 2022-11-28 13:55:05 +08:00
Enchantment.cs WIP: Added some strctured components 2024-09-11 19:12:31 +02:00
EnchantmentData.cs WIP: Added some strctured components 2024-09-11 19:12:31 +02:00
EnchantmentMapping.cs Fix enchantment name display for 1.20.6 structured components 2026-03-19 02:01:15 +08:00
EnchantmentPropertyInfo.cs Added enchanting 2022-10-12 19:51:01 +02:00
Enchantments.cs Fix enchantment name display for 1.20.6 structured components 2026-03-19 02:01:15 +08:00
Hand.cs [SKIP_BUILD] Change file encoding to UTF-8 with BOM 2022-11-28 13:55:05 +08:00
Item.cs Wire up 1.20.6 structured components to Item and fix GetItemSlot serialization 2026-03-19 00:34:10 +08:00
ItemMovingHelper.cs Implement command completion suggestions. 2022-12-06 15:50:17 +08:00
ItemRarity.cs WIP: Added some strctured components 2024-09-11 19:12:31 +02:00
ItemType.cs Inventory, Terrain and Entity handling 2024-07-02 11:08:46 +02:00
ItemTypeExtensions.cs Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00
SuspiciousStewEffect.cs Added more structured components 2024-09-11 20:58:24 +02:00
TrimAssetOverride.cs Implemented all structured components, renamed them all to a better format 2024-10-05 13:37:52 +02:00
VillagerInfo.cs Implement command completion suggestions. 2022-12-06 15:50:17 +08:00
VillagerTrade.cs Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00
WindowActionType.cs Added ShiftRightClick (#2582) 2023-09-16 19:39:55 +08:00