From 973300357d57ad9c734e3835a217a8554dd16a2d Mon Sep 17 00:00:00 2001 From: Michieal Date: Wed, 1 Feb 2023 23:24:59 -0500 Subject: [PATCH] Removed "scraping_copper_block" function. Fixed the wax copper blocks variants to have the wax removed. --- mods/ITEMS/mcl_copper/functions.lua | 40 ----------------------------- mods/ITEMS/mcl_copper/nodes.lua | 16 ++++++------ 2 files changed, 8 insertions(+), 48 deletions(-) diff --git a/mods/ITEMS/mcl_copper/functions.lua b/mods/ITEMS/mcl_copper/functions.lua index 1b861f5cd..ccb374214 100644 --- a/mods/ITEMS/mcl_copper/functions.lua +++ b/mods/ITEMS/mcl_copper/functions.lua @@ -13,20 +13,6 @@ function mcl_copper.on_place (itemstack, placer, pointed_thing) return itemstack end - -- Apply scraping with an axe. (string.find returns nil if the string is not found.) - local wield_item = placer:get_wielded_item() - if string.find (wield_item:get_name(), "tools:axe" ) ~= nil then - if string.find(node_name, "mcl_copper") ~= nil then - if string.find(node_name, "waxed") ~= nil then - local item = mcl_copper.scraping_copper_block(pos, node, placer, wield_item) - if item and item:get_name() ~= "" then - placer:set_wielded_item(item) -- add wear to the axe. - return - end - end - end - end - -- Use pointed node's on_rightclick function first, if present local new_stack = mcl_util.call_on_rightclick(itemstack, placer, pointed_thing) if new_stack then @@ -78,32 +64,6 @@ function mcl_copper.waxing_copper_block(pos, node, player, itemstack) end end -function mcl_copper.scraping_copper_block(pos, node, player, itemstack) - if itemstack:get_name():find("axe") then - -- prevent modification of protected nodes. - if mcl_util.check_position_protection(pos, player) then - return - end - - local def = minetest.registered_nodes[node.name] - - if def and def._mcl_copper_unwaxed_variant then - node.name = def._mcl_copper_unwaxed_variant - end - - minetest.set_node(pos, node) - awards.unlock(player:get_player_name(), "mcl:wax_off") - if not minetest.is_creative_enabled(player:get_player_name()) then - local tool = itemstack:get_name() - local wear = mcl_autogroup.get_wear(tool, "axey") - itemstack:add_wear(wear) - return itemstack - end - else - return - end -end - --[[ local stairs = { {"stair", "exposed", "_inner", "cut_inner"}, diff --git a/mods/ITEMS/mcl_copper/nodes.lua b/mods/ITEMS/mcl_copper/nodes.lua index e5bc047f7..f581eb416 100644 --- a/mods/ITEMS/mcl_copper/nodes.lua +++ b/mods/ITEMS/mcl_copper/nodes.lua @@ -47,7 +47,7 @@ minetest.register_node("mcl_copper:waxed_block", { sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 3, - _mcl_copper_unwaxed_variant = "mcl_copper:block", + _mcl_stripped_variant = "mcl_copper:block", on_place = mcl_copper.on_place, }) @@ -74,7 +74,7 @@ minetest.register_node("mcl_copper:waxed_block_exposed", { sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, - _mcl_copper_unwaxed_variant = "mcl_copper:block", + _mcl_stripped_variant = "mcl_copper:block", on_place = mcl_copper.on_place, }) @@ -101,7 +101,7 @@ minetest.register_node("mcl_copper:waxed_block_weathered", { sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, - _mcl_copper_unwaxed_variant = "mcl_copper:block_exposed", + _mcl_stripped_variant = "mcl_copper:block_exposed", on_place = mcl_copper.on_place, }) @@ -128,7 +128,7 @@ minetest.register_node("mcl_copper:waxed_block_oxidized", { sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, - _mcl_copper_unwaxed_variant = "mcl_copper:block_weathered", + _mcl_stripped_variant = "mcl_copper:block_weathered", on_place = mcl_copper.on_place, }) @@ -154,7 +154,7 @@ minetest.register_node("mcl_copper:waxed_block_cut", { sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, - _mcl_copper_unwaxed_variant = "mcl_copper:block_cut", + _mcl_stripped_variant = "mcl_copper:block_cut", on_place = mcl_copper.on_place, }) @@ -181,7 +181,7 @@ minetest.register_node("mcl_copper:waxed_block_exposed_cut", { sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, - _mcl_copper_unwaxed_variant = "mcl_copper:block_cut", + _mcl_stripped_variant = "mcl_copper:block_cut", on_place = mcl_copper.on_place, }) @@ -208,7 +208,7 @@ minetest.register_node("mcl_copper:waxed_block_weathered_cut", { sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, - _mcl_copper_unwaxed_variant = "mcl_copper:block_exposed_cut", + _mcl_stripped_variant = "mcl_copper:block_exposed_cut", on_place = mcl_copper.on_place, }) @@ -235,7 +235,7 @@ minetest.register_node("mcl_copper:waxed_block_oxidized_cut", { sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, - _mcl_copper_unwaxed_variant = "mcl_copper:block_weathered_cut", + _mcl_stripped_variant = "mcl_copper:block_weathered_cut", on_place = mcl_copper.on_place, })