2023-10-11 17:05:38 +00:00
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
|
|
|
|
blockgame.crafting.register_pummel_recipe({
|
2023-10-17 12:53:08 +00:00
|
|
|
name = modname .. ":chop_log",
|
|
|
|
label = "chop log into plank",
|
|
|
|
used = {"group:stoney"},
|
|
|
|
target = {"bg_tree:log"},
|
2023-10-11 17:05:38 +00:00
|
|
|
check = function (pos, used_node, target_node)
|
|
|
|
for _, side in pairs(blockgame.vector.sides) do
|
|
|
|
local output_pos = pos + side
|
|
|
|
if minetest.get_node(output_pos).name ~= "air" then return false end
|
|
|
|
end
|
|
|
|
return true
|
|
|
|
end,
|
|
|
|
on_success = function (pos, used_node, target_node)
|
|
|
|
minetest.remove_node(pos)
|
|
|
|
for _, side in pairs(blockgame.vector.sides) do
|
|
|
|
local output_pos = pos + side
|
|
|
|
minetest.set_node(output_pos, {name = modname .. ":plank"})
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|