blockgame/mods/bg_funnel/recipe.lua

17 lines
548 B
Lua
Raw Normal View History

2023-10-14 13:33:24 +00:00
local modname = minetest.get_current_modname()
blockgame.crafting.register_pummel_recipe({
label = "pummel logs into funnel",
used_item = "woodworking:plank",
target_node = "bg_tree:log",
2023-10-14 13:33:24 +00:00
check = function (pos, used_node, target_node)
local below = pos + blockgame.vector.dirs.down
return minetest.get_node(below).name == "bg_tree:log"
2023-10-14 13:33:24 +00:00
end,
on_success = function (pos, used_node, target_node)
local below = pos + blockgame.vector.dirs.down
minetest.remove_node(pos)
minetest.set_node(below, {name = modname .. ":funnel"})
end,
})