From 5be506830f7fb0b0c435855ae6e7a7bb6aeb3e1a Mon Sep 17 00:00:00 2001 From: chmodsayshello Date: Wed, 25 Oct 2023 17:20:50 +0200 Subject: [PATCH] make diamond tools upgradeable again --- mods/ITEMS/mcl_smithing_table/init.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_smithing_table/init.lua b/mods/ITEMS/mcl_smithing_table/init.lua index 1794f8791..996dcf8a9 100755 --- a/mods/ITEMS/mcl_smithing_table/init.lua +++ b/mods/ITEMS/mcl_smithing_table/init.lua @@ -167,16 +167,19 @@ minetest.register_node("mcl_smithing_table:table", { end, allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local stackname = stack:get_name() + local def = stack:get_definition() if listname == "upgrade_item" - and string.find(stack:get_name(),"mcl_armor:") -- allow any armor piece to go in (in case the player wants to trim them) - and not mcl_armor.trims.blacklisted[stack:get_name()] + and def._mcl_armor_element -- allow any armor piece to go in (in case the player wants to trim them) + and not mcl_armor.trims.blacklisted[stackname] + or def._mcl_upgradable -- for diamond tools or listname == "mineral" - and mcl_smithing_table.is_smithing_mineral(stack:get_name()) + and mcl_smithing_table.is_smithing_mineral(stackname) or listname == "template" - and string.find(stack:get_name(),"mcl_armor") + and string.find(stackname, "mcl_armor") then return stack:get_count() end