1
0
Fork 0

make armor upgrade slightly more flexible

This commit is contained in:
cora 2022-06-27 12:40:21 +02:00
parent d86be83b2b
commit 7136e54615
2 changed files with 3 additions and 3 deletions

View File

@ -115,8 +115,8 @@ function mcl_armor.register_set(def)
groups[k] = v
end
local upgrade_item = nil
if itemstring:find("_diamond") then
upgrade_item = itemstring:gsub("_diamond","_netherite")
if itemstring:find("_diamond") and def._mcl_upgrade_item_material then
upgrade_item = itemstring:gsub("_[%l%d]*$",def._mcl_upgrade_item_material)
end
minetest.register_tool(itemstring, {

View File

@ -80,7 +80,7 @@ mcl_armor.register_set({
toughness = 2,
craft_material = "mcl_core:diamond",
_mcl_upgradable = true,
_mcl_upgrade_item_add = "_netherite"
_mcl_upgrade_item_material = "_netherite"
})
mcl_armor.register_set({