blockgame/mods/bg_funnel/recipe.lua
trans_soup 7755583fa4 rename mods and add hacky cleanup thing.
rename mods; add `bg_` prefix.

add hacky cleanup ABM (couldn't get LBM:s to work), that converts old
nodes into new ones according to this rename.

the cleanup doesn't do anything for items, though.
2023-10-15 18:22:13 +02:00

16 lines
548 B
Lua

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",
check = function (pos, used_node, target_node)
local below = pos + blockgame.vector.dirs.down
return minetest.get_node(below).name == "bg_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,
})