add crafting
This commit is contained in:
parent
64c9f16743
commit
be04e2c95c
39
init.lua
39
init.lua
@ -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 |
Loading…
Reference in New Issue
Block a user