diff --git a/MinecraftClient/Inventory/EnchantmentMapping.cs b/MinecraftClient/Inventory/EnchantmentMapping.cs index 791cdf37..8b82f156 100644 --- a/MinecraftClient/Inventory/EnchantmentMapping.cs +++ b/MinecraftClient/Inventory/EnchantmentMapping.cs @@ -49,7 +49,8 @@ namespace MinecraftClient.Inventory { 33, Enchantment.VanishingCurse } }; - private static Dictionary enchantmentMappings116Plus = new Dictionary() + // 1.16 - 1.18 + private static Dictionary enchantmentMappings116 = new Dictionary() { //id type { 0, Enchantment.Protection }, @@ -92,6 +93,51 @@ namespace MinecraftClient.Inventory { 37, Enchantment.VanishingCurse } }; + // 1.19+ + private static Dictionary enchantmentMappings = new Dictionary() + { + //id type + { 0, Enchantment.Protection }, + { 1, Enchantment.FireProtection }, + { 2, Enchantment.FeatherFalling }, + { 3, Enchantment.BlastProtection }, + { 4, Enchantment.ProjectileProtection }, + { 5, Enchantment.Respiration }, + { 6, Enchantment.AquaAffinity }, + { 7, Enchantment.Thorns }, + { 8, Enchantment.DepthStrieder }, + { 9, Enchantment.FrostWalker }, + { 10, Enchantment.BindingCurse }, + { 11, Enchantment.SoulSpeed }, + { 12, Enchantment.SwiftSneak }, + { 13, Enchantment.Sharpness }, + { 14, Enchantment.Smite }, + { 15, Enchantment.BaneOfArthropods }, + { 16, Enchantment.Knockback }, + { 17, Enchantment.FireAspect }, + { 18, Enchantment.Looting }, + { 19, Enchantment.Sweeping }, + { 20, Enchantment.Efficency }, + { 21, Enchantment.SilkTouch }, + { 22, Enchantment.Unbreaking }, + { 23, Enchantment.Fortune }, + { 24, Enchantment.Power }, + { 25, Enchantment.Punch }, + { 26, Enchantment.Flame }, + { 27, Enchantment.Infinity }, + { 28, Enchantment.LuckOfTheSea }, + { 29, Enchantment.Lure }, + { 30, Enchantment.Loyality }, + { 31, Enchantment.Impaling }, + { 32, Enchantment.Riptide }, + { 33, Enchantment.Channeling }, + { 34, Enchantment.Multishot }, + { 35, Enchantment.QuickCharge }, + { 36, Enchantment.Piercing }, + { 37, Enchantment.Mending }, + { 38, Enchantment.VanishingCurse } + }; + private static Dictionary enchantmentNames = new Dictionary() { //type @@ -107,6 +153,7 @@ namespace MinecraftClient.Inventory { Enchantment.FrostWalker, "Enchantment.FrostWalker" }, { Enchantment.BindingCurse, "Enchantment.BindingCurse" }, { Enchantment.SoulSpeed, "Enchantment.SoulSpeed" }, + { Enchantment.SwiftSneak, "Enchantment.SwiftSneak" }, { Enchantment.Sharpness, "Enchantment.Sharpness" }, { Enchantment.Smite, "Enchantment.Smite" }, { Enchantment.BaneOfArthropods, "Enchantment.BaneOfArthropods" }, @@ -141,10 +188,12 @@ namespace MinecraftClient.Inventory if (protocolVersion < Protocol18Handler.MC_1_14_Version) throw new Exception("Enchantments mappings are not implemented bellow 1.14"); - Dictionary map = enchantmentMappings116Plus; + Dictionary map = enchantmentMappings; if (protocolVersion >= Protocol18Handler.MC_1_14_Version && protocolVersion < Protocol18Handler.MC_1_16_Version) map = enchantmentMappings114; + else if (protocolVersion >= Protocol18Handler.MC_1_16_Version && protocolVersion < Protocol18Handler.MC_1_19_Version) + map = enchantmentMappings116; if (!map.ContainsKey(id)) throw new Exception("Got an Unknown Enchantment ID '" + id + "', please update the Mappings!"); diff --git a/MinecraftClient/Inventory/Enchantments.cs b/MinecraftClient/Inventory/Enchantments.cs index 10baf22d..34279de0 100644 --- a/MinecraftClient/Inventory/Enchantments.cs +++ b/MinecraftClient/Inventory/Enchantments.cs @@ -15,6 +15,7 @@ FrostWalker, BindingCurse, SoulSpeed, + SwiftSneak, Sharpness, Smite, BaneOfArthropods, diff --git a/MinecraftClient/McClient.cs b/MinecraftClient/McClient.cs index 6667660e..5008cbaa 100644 --- a/MinecraftClient/McClient.cs +++ b/MinecraftClient/McClient.cs @@ -2671,8 +2671,6 @@ namespace MinecraftClient inventory.Properties.Add(propertyId, propertyValue); - Log.Info("Got a property " + propertyId + " with value: " + propertyValue); - DispatchBotEvent(bot => bot.OnInventoryProperties(inventoryID, propertyId, propertyValue)); if (inventory.Type == ContainerType.Enchantment) diff --git a/MinecraftClient/Resources/lang/en.ini b/MinecraftClient/Resources/lang/en.ini index a3e4a6ab..3a352f44 100644 --- a/MinecraftClient/Resources/lang/en.ini +++ b/MinecraftClient/Resources/lang/en.ini @@ -171,6 +171,7 @@ Enchantment.DepthStrieder=Depth Strieder Enchantment.FrostWalker=Frost Walker Enchantment.BindingCurse=Curse of Binding Enchantment.SoulSpeed=Soul Speed +Enchantment.SwiftSneak=Swift Sneak Enchantment.Sharpness=Sharpness Enchantment.Smite=Smite Enchantment.BaneOfArthropods=Bane of Arthropods