From 05979ed69058070084caa09b974d7edb1f492dd1 Mon Sep 17 00:00:00 2001 From: cora Date: Wed, 24 Aug 2022 02:19:57 +0200 Subject: [PATCH] Fix enchanted tools not being properly upgraded --- mods/ITEMS/mcl_smithing_table/init.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mods/ITEMS/mcl_smithing_table/init.lua b/mods/ITEMS/mcl_smithing_table/init.lua index f32cb8c281..dbb6c620fc 100644 --- a/mods/ITEMS/mcl_smithing_table/init.lua +++ b/mods/ITEMS/mcl_smithing_table/init.lua @@ -7,19 +7,15 @@ mcl_smithing_table = {} -- Function to upgrade diamond tool/armor to netherite tool/armor function mcl_smithing_table.upgrade_item(itemstack) - itemstack = ItemStack(itemstack) -- Copy the stack - local def = itemstack:get_definition() if not def or not def._mcl_upgradable then return end - local itemname = itemstack:get_name() + local upgrade_item = itemname:gsub("diamond", "netherite") - local upgrade_item = def._mcl_upgrade_item or itemname:gsub("diamond", "netherite") - - if upgrade_item == itemname then + if def._mcl_upgrade_item and upgrade_item == itemname then return end