mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-16 16:11:06 +01:00
Fix upgrading of enchanted items
This commit is contained in:
parent
24dfda8d7e
commit
f79ace6306
1 changed files with 7 additions and 5 deletions
|
@ -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 a new issue