add crafting

This commit is contained in:
whosit 2024-02-11 20:51:31 +03:00
parent 64c9f16743
commit be04e2c95c
2 changed files with 39 additions and 0 deletions

View File

@ -96,3 +96,42 @@ minetest.register_node("yl_dice:dice", {
roll_dice(pos)
end,
})
local BASE_BLOCK
if minetest.get_modpath("yl_nether") then
-- FIXME check if this item is actually registered
BASE_BLOCK = "yl_nether:ivory_block"
end
if BASE_BLOCK then
minetest.register_craft({
type = "shaped",
output = minetest.itemstring_with_palette("yl_dice:dice", 0),
recipe = {
{ BASE_BLOCK, "dye:black", "" },
{ "", "", "" },
{ "", "", "" },
}
})
local colors = {
"red",
"blue",
"violet",
"orange",
"yellow",
"green",
"cyan",
}
for i, color in ipairs(colors) do
minetest.register_craft({
type = "shaped",
output = minetest.itemstring_with_palette("yl_dice:dice", 32 * i),
recipe = {
{ "yl_dice:dice", "dye:" .. color, "" },
{ "", "", "" },
{ "", "", "" },
}
})
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 493 B

After

Width:  |  Height:  |  Size: 493 B