mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-04 14:53:51 +01:00
Merge pull request 'Fix enchanted tools not being properly upgraded' (#2586) from fix_netherite_upgrade into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/2586 Reviewed-by: MysticTempest <mystictempest@noreply.git.minetest.land>
This commit is contained in:
commit
0385dd7cab
@ -7,19 +7,15 @@ mcl_smithing_table = {}
|
|||||||
|
|
||||||
-- Function to upgrade diamond tool/armor to netherite tool/armor
|
-- Function to upgrade diamond tool/armor to netherite tool/armor
|
||||||
function mcl_smithing_table.upgrade_item(itemstack)
|
function mcl_smithing_table.upgrade_item(itemstack)
|
||||||
itemstack = ItemStack(itemstack) -- Copy the stack
|
|
||||||
|
|
||||||
local def = itemstack:get_definition()
|
local def = itemstack:get_definition()
|
||||||
|
|
||||||
if not def or not def._mcl_upgradable then
|
if not def or not def._mcl_upgradable then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local itemname = itemstack:get_name()
|
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 def._mcl_upgrade_item and upgrade_item == itemname then
|
||||||
|
|
||||||
if upgrade_item == itemname then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user