Support moretrees added!

This commit is contained in:
minefaco
2020-11-09 09:10:05 -05:00
committed by GitHub
parent 7ec025b04c
commit 8b332e61e7

View File

@@ -41,14 +41,16 @@ function chisel_tree.register_axes(mod_name,axe_types)
end end
local node = minetest.get_node(pos).name local node = minetest.get_node(pos).name
local mod_name, node_name = unpack(node:split(":"))
local has_stripped = minetest.registered_nodes[mod_name..":".."stripped_"..node_name]
for _, n in ipairs(trunk_names) do
local tree = mod_name..":"..n if has_stripped then
if tree==node then
local old_node = minetest.get_node(pos) local old_node = minetest.get_node(pos)
minetest.swap_node(pos, {name = mod_name..":".."stripped_"..n, param2 = old_node.param2}) minetest.swap_node(pos, {name = mod_name..":".."stripped_"..node_name, param2 = old_node.param2})
itemstack:add_wear(65535 / 299) -- 300 uses itemstack:add_wear(65535 / 299) -- 300 uses
minetest.chat_send_all(mod_name)
minetest.chat_send_all(node_name)
if not creative_mode then if not creative_mode then
local inv = user:get_inventory() local inv = user:get_inventory()
@@ -62,7 +64,6 @@ function chisel_tree.register_axes(mod_name,axe_types)
return itemstack return itemstack
end end
end
end, end,
}) })
@@ -70,7 +71,3 @@ function chisel_tree.register_axes(mod_name,axe_types)
end end
--register alias to support old tool --register alias to support old tool
minetest.register_alias("chisel_tree:chisel", "default:axe_steel") minetest.register_alias("chisel_tree:chisel", "default:axe_steel")