blockgame/mods/bg_funnel/recipe.lua
2023-10-14 15:33:24 +02:00

16 lines
542 B
Lua

local modname = minetest.get_current_modname()
blockgame.crafting.register_pummel_recipe({
label = "pummel logs into funnel",
used_item = "woodworking:plank",
target_node = "tree:log",
check = function (pos, used_node, target_node)
local below = pos + blockgame.vector.dirs.down
return minetest.get_node(below).name == "tree:log"
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,
})