blockgame/mods/bg_stoneworking/recipes.lua
trans_soup a68bed3c70 change stoneworking recipes.
tile and bricks recipes now use cobblestone instead of stone, to make
them available again now that stone drops cobblestone.
2023-10-12 10:26:02 +02:00

29 lines
1.1 KiB
Lua

local modname = minetest.get_current_modname()
blockgame.crafting.register_pummel_recipe({
label = "pummel stone into tile",
used_item = "core:cobblestone",
target_node = "core:cobblestone",
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({
label = "pummel tile into bricks",
used_item = "core:cobblestone",
target_node = modname .. ":tile",
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,
})