Fix upgrading of enchanted items
parent
24dfda8d7e
commit
f79ace6306
|
@ -17,16 +17,18 @@ function mcl_smithing_table.upgrade_item(itemstack)
|
|||
|
||||
local itemname = itemstack:get_name()
|
||||
|
||||
local upgrade_item = def._mcl_upgrade_item or itemname:gsub("diamond", "netherite")
|
||||
local upgrade_item = def._mcl_upgrade_item
|
||||
|
||||
if upgrade_item and mcl_enchanting.is_enchanted(itemname) then
|
||||
upgrade_item = upgrade_item .. "_enchanted"
|
||||
end
|
||||
|
||||
upgrade_item = upgrade_item or itemname:gsub("diamond", "netherite")
|
||||
|
||||
if upgrade_item == itemname then
|
||||
return
|
||||
end
|
||||
|
||||
if mcl_enchanting.is_enchanted(itemname) then
|
||||
upgrade_item = upgrade_item .. "_enchanted"
|
||||
end
|
||||
|
||||
itemstack:set_name(upgrade_item)
|
||||
|
||||
-- Reload the ToolTips of the tool
|
||||
|
|
Loading…
Reference in New Issue