diff --git a/init.lua b/init.lua index 265c3e3..b9f7e81 100644 --- a/init.lua +++ b/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 diff --git a/textures/yl_dice_6_palette.png b/textures/yl_dice_6_palette.png index c627112..92125bb 100644 Binary files a/textures/yl_dice_6_palette.png and b/textures/yl_dice_6_palette.png differ