From be04e2c95ce51fea6dea846905c604f979f79303 Mon Sep 17 00:00:00 2001 From: whosit Date: Sun, 11 Feb 2024 20:51:31 +0300 Subject: [PATCH] add crafting --- init.lua | 39 +++++++++++++++++++++++++++++++++ textures/yl_dice_6_palette.png | Bin 493 -> 493 bytes 2 files changed, 39 insertions(+) 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 c6271123da2d133911b3809488beae7729bc9c1e..92125bbf151a4dc684edaedcff87ba5ca0d8a1c5 100644 GIT binary patch delta 32 ncmaFM{FZscRYr+`LktX`bht0wc-;Aj0SG)@{an^LB{Ts5-VF?- delta 32 ncmaFM{FZscRYr*iM;RDC-r!zwTdJ3v0SG)@{an^LB{Ts5-);;a