mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 12:01:06 +01:00
Removed "scraping_copper_block" function.
Fixed the wax copper blocks variants to have the wax removed.
This commit is contained in:
parent
4b0b3217e2
commit
b771f314fe
2 changed files with 8 additions and 48 deletions
|
@ -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"},
|
||||
|
|
|
@ -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,
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue