2023-10-11 08:28:23 +00:00
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
|
2023-10-11 09:40:41 +00:00
|
|
|
blockgame.crafting.register_pummel_recipe({
|
2023-10-17 12:53:08 +00:00
|
|
|
name = modname .. ":craft_tile",
|
2023-10-11 09:40:41 +00:00
|
|
|
label = "pummel stone into tile",
|
2023-10-17 12:53:08 +00:00
|
|
|
used = {"group:stoney"},
|
|
|
|
target = {"bg_terrain:cobblestone"},
|
2023-10-11 09:40:41 +00:00
|
|
|
check = function (pos, used_node, target_node)
|
|
|
|
local below_node = minetest.get_node(pos + blockgame.vector.dirs.down)
|
|
|
|
local stoney_value = minetest.get_item_group(below_node.name, "stoney")
|
|
|
|
return stoney_value ~= 0 and stoney_value ~= nil
|
|
|
|
end,
|
|
|
|
on_success = function (pos, used_node, target_node)
|
|
|
|
minetest.set_node(pos, {name = modname .. ":tile"})
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
blockgame.crafting.register_pummel_recipe({
|
2023-10-17 12:53:08 +00:00
|
|
|
name = modname .. ":craft_bricks",
|
2023-10-11 09:40:41 +00:00
|
|
|
label = "pummel tile into bricks",
|
2023-10-17 12:53:08 +00:00
|
|
|
used = {"group:stoney"},
|
|
|
|
target = {modname .. ":tile"},
|
2023-10-11 09:40:41 +00:00
|
|
|
check = function (pos, used_node, target_node)
|
|
|
|
local below_node = minetest.get_node(pos + blockgame.vector.dirs.down)
|
|
|
|
local stoney_value = minetest.get_item_group(below_node.name, "stoney")
|
|
|
|
return stoney_value ~= 0 and stoney_value ~= nil
|
|
|
|
end,
|
|
|
|
on_success = function (pos, used_node, target_node)
|
|
|
|
minetest.set_node(pos, {name = modname .. ":bricks"})
|
|
|
|
end,
|
|
|
|
})
|