7df4ddec1c
move plank registration and recipe out of tree mod into newly created woodworking mod. also update plank recipe to require cobblestone instead of stone to be held while pummeling.
21 lines
657 B
Lua
21 lines
657 B
Lua
local modname = minetest.get_current_modname()
|
|
|
|
blockgame.crafting.register_pummel_recipe({
|
|
label = "pummel log into plank",
|
|
used_item = "core:cobblestone",
|
|
target_node = "tree:log",
|
|
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,
|
|
})
|