From 88ea99298446e140ebdb4365aa61262439306196 Mon Sep 17 00:00:00 2001 From: Meow Date: Fri, 8 Nov 2024 05:32:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B1=D0=B0=D0=B3=D0=B0=20=D1=81=20?= =?UTF-8?q?=D0=B2=D1=8B=D0=BB=D0=B5=D1=82=D0=BE=D0=BC=20=D0=B8=D0=B3=D1=80?= =?UTF-8?q?=D1=8B=20=D0=BF=D1=80=D0=B8=20=D0=BD=D0=B0=D0=B6=D0=B0=D1=82?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=9F=D0=9A=D0=9C=20=D0=BD=D0=B0=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=8B=D0=B5=20=D0=B1=D0=BB=D0=BE=D0=BA=D0=B8=20=D0=B4?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mods/ITEMS/mcl_tools/init.lua | 45 ++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/mods/ITEMS/mcl_tools/init.lua b/mods/ITEMS/mcl_tools/init.lua index 266adc6fc..f26ebf46e 100644 --- a/mods/ITEMS/mcl_tools/init.lua +++ b/mods/ITEMS/mcl_tools/init.lua @@ -411,22 +411,35 @@ local function make_stripped_trunk(itemstack, placer, pointed_thing) end if noddef._mcl_stripped_variant == nil then - return itemstack - else - minetest.swap_node(pointed_thing.under, {name=noddef._mcl_stripped_variant, param2=node.param2}) - if minetest.get_item_group(node_name, "waxed") ~= 0 then - awards.unlock(placer:get_player_name(), "mcl:wax_off") - end - if not minetest.is_creative_enabled(placer:get_player_name()) then - -- Add wear (as if digging a axey node) - local toolname = itemstack:get_name() - local wear = mcl_autogroup.get_wear(toolname, "axey") - if wear then - itemstack:add_wear(wear) - tt.reload_itemstack_description(itemstack) -- update tooltip - end - end - end + return itemstack + else + if minetest.registered_nodes[noddef._mcl_stripped_variant] == nil then + -- vl_hollow_logs:acaciatree_hollow -> vl_hollow_logs:stripped_acacia_hollow + + local node_name_try = "vl_hollow_logs:stripped_" .. string.sub(node_name, 16, -12) .. "_hollow" + --core.chat_send_all(node_name_try) + if minetest.registered_nodes[node_name_try] == nil then + return + else + minetest.swap_node(pointed_thing.under, {name=node_name_try, param2=node.param2}) + end + else + minetest.swap_node(pointed_thing.under, {name=noddef._mcl_stripped_variant, param2=node.param2}) + end + + if minetest.get_item_group(node_name, "waxed") ~= 0 then + awards.unlock(placer:get_player_name(), "mcl:wax_off") + end + if not minetest.is_creative_enabled(placer:get_player_name()) then + -- Add wear (as if digging a axey node) + local toolname = itemstack:get_name() + local wear = mcl_autogroup.get_wear(toolname, "axey") + if wear then + itemstack:add_wear(wear) + tt.reload_itemstack_description(itemstack) -- update tooltip + end + end + end return itemstack end