_G.leko_pan = {} leko_pan.colors = {"loje", "loje2", "jelo", "laso", "laso2", "laso3", "unu", "pimeja"} leko_pan.colors_rgb = {{255, 64, 64},{255, 128, 0},{192, 192, 64},{0, 192, 0},{0, 192, 192},{64, 64, 255},{192, 0, 192},{128, 128, 128}} leko_pan.colors_map = {} for i, v in ipairs(leko_pan.colors) do leko_pan.colors_map[v] = leko_pan.colors_rgb[i] end minetest.register_node(":alasa_pan:leko", { description = "leko", tiles = {"leko.png"}, groups = {} }) minetest.register_node(":alasa_pan:anpa", { description = "anpa", tiles = {"leko_anpa.png"}, groups = {} }) for _, v in pairs(leko_pan.colors) do local name = v if v:sub(#v, #v) == "2" or v:sub(#v, #v) == "3" then name = name:sub(1, #v-1) end minetest.register_node(":alasa_pan:leko_"..v, { description = "leko "..v, tiles = {"leko_"..v..".png"}, groups = {oddly_breakable_by_hand = 2} }) end local function hex_string(r, g, b) return ("%02X%02X%02X"):format(r, g, b) end for i, v in ipairs(leko_pan.colors) do local r, g, b = 255-leko_pan.colors_rgb[i][1], 255-leko_pan.colors_rgb[i][2], 255-leko_pan.colors_rgb[i][3] minetest.register_node(":alasa_pan:nasin_"..v, { description = "nasin "..v, tiles = {"anpa_nasin.png^[invert:rgb^[multiply:#"..hex_string(r, g, b).."^[invert:rgb"}, groups = {} }) end local ingredient_box = {type="fixed", fixed={-0.375, -0.375, -0.375, 0.375, 0.375, 0.375}} minetest.register_node(":alasa_pan:ko_pan", { description = "ko pan", tiles = {"ko_pan.png"}, groups = {oddly_breakable_by_hand = 1}, drawtype = "nodebox", walkable = false, node_box = ingredient_box, paramtype = "light", sunlight_propagates = true, use_texture_alpha = "clip" }) minetest.register_node(":alasa_pan:ko_suli", { description = "ko suli", tiles = {"ko_suli.png"}, groups = {oddly_breakable_by_hand = 1}, drawtype = "nodebox", walkable = false, node_box = ingredient_box, paramtype = "light", sunlight_propagates = true, use_texture_alpha = "clip" }) minetest.register_node(":alasa_pan:telo", { description = "telo", tiles = {"telo.png"}, groups = {oddly_breakable_by_hand = 1}, drawtype = "nodebox", walkable = false, node_box = ingredient_box, paramtype = "light", sunlight_propagates = true, use_texture_alpha = "clip" }) minetest.register_node(":alasa_pan:pan", { description = "pan", tiles = { "pan_t.png", -- +Y "pan_s2.png", -- -Y "pan_s.png", -- +X "pan_s.png", -- -X "pan_s2.png", -- +Z "pan_s2.png", -- -Z }, groups = {oddly_breakable_by_hand = 1}, drawtype = "nodebox", walkable = false, node_box = { type="fixed", fixed={ {-0.375, -0.5, -0.25, 0.375, 0, 0.25}, {-0.375, 0, -0.375, 0.375, 0.25, 0.375}, } }, paramtype = "light", sunlight_propagates = true, use_texture_alpha = "clip" }) minetest.register_node(":alasa_pan:ilo_pona", { description = "ilo pona", tiles = {"ilo_pona.png"}, groups = {} }) minetest.register_node(":alasa_pan:ilo_seli", { description = "ilo seli", tiles = {"ilo_seli.png"}, groups = {} }) minetest.register_node(":alasa_pan:monsuta", { description = "monsuta", tiles = {"monsuta.png"}, drawtype = "glasslike", groups = {}, walkable = false, use_texture_alpha = "clip" })