1 -- Other mods can use these for looping through available colors
4 dye.basecolors = {"white", "grey", "black", "red", "yellow", "green", "cyan", "blue", "magenta"}
5 dye.excolors = {"white", "lightgrey", "grey", "darkgrey", "black", "red", "orange", "yellow",
6 "lime", "green", "aqua", "cyan", "sky_blue", "blue", "violet", "magenta", "red_violet"}
8 -- Make dye names and descriptions available globally
13 {"dark_grey", "Dark grey"},
18 {"dark_green", "Dark green"},
24 {"magenta", "Magenta"},
28 -- This collection of colors is partly a historic thing, partly something else
31 {"white", "White dye", {dye=1, basecolor_white=1, excolor_white=1, unicolor_white=1}},
32 {"grey", "Grey dye", {dye=1, basecolor_grey=1, excolor_grey=1, unicolor_grey=1}},
33 {"dark_grey", "Dark grey dye", {dye=1, basecolor_grey=1, excolor_darkgrey=1, unicolor_darkgrey=1}},
34 {"black", "Black dye", {dye=1, basecolor_black=1, excolor_black=1, unicolor_black=1}},
35 {"violet", "Violet dye", {dye=1, basecolor_magenta=1, excolor_violet=1, unicolor_violet=1}},
36 {"blue", "Blue dye", {dye=1, basecolor_blue=1, excolor_blue=1, unicolor_blue=1}},
37 {"cyan", "Cyan dye", {dye=1, basecolor_cyan=1, excolor_cyan=1, unicolor_cyan=1}},
38 {"dark_green", "Dark green dye", {dye=1, basecolor_green=1, excolor_green=1, unicolor_dark_green=1}},
39 {"green", "Green dye", {dye=1, basecolor_green=1, excolor_green=1, unicolor_green=1}},
40 {"yellow", "Yellow dye", {dye=1, basecolor_yellow=1, excolor_yellow=1, unicolor_yellow=1}},
41 {"brown", "Brown dye", {dye=1, basecolor_brown=1, excolor_orange=1, unicolor_dark_orange=1}},
42 {"orange", "Orange dye", {dye=1, basecolor_orange=1, excolor_orange=1, unicolor_orange=1}},
43 {"red", "Red dye", {dye=1, basecolor_red=1, excolor_red=1, unicolor_red=1}},
44 {"magenta", "Magenta dye", {dye=1, basecolor_magenta=1, excolor_red_violet=1, unicolor_red_violet=1}},
45 {"pink", "Pink dye", {dye=1, basecolor_red=1, excolor_red=1, unicolor_light_red=1}},
50 for _, row in ipairs(dyes) do
52 local description = row[2]
54 local item_name = "dye:" .. name
55 local item_image = "dye_" .. name .. ".png"
56 minetest.register_craftitem(item_name, {
57 inventory_image = item_image,
58 description = description,
61 minetest.register_craft({
63 output = item_name .. " 4",
64 recipe = {"group:flower,color_" .. name},
68 -- Manually add coal->black dye
70 minetest.register_craft({
72 output = "dye:black 4",
73 recipe = {"group:coal"},
77 -- Just mix everything to everything somehow sanely
79 local mixbases = {"pink", "magenta", "red", "orange", "brown", "yellow", "green", "dark_green", "cyan", "blue", "violet", "black", "dark_grey", "grey", "white"}
82 -- pink, magenta, red, orange, brown, yellow, green, dark_green, cyan, blue, violet, black, dark_grey, grey, white
83 white = {"pink", "pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "violet","grey", "grey", "grey","white"},
84 grey = {"pink", "pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "violet","dark_grey","grey", "grey"},
85 dark_grey = {"brown", "brown", "brown", "brown", "brown", "brown", "dark_green","dark_green","blue", "blue", "violet","black", "dark_grey"},
86 black = {"black", "black", "black", "black", "black", "black", "black", "black", "black","black", "black", "black"},
87 violet = {"magenta","magenta","magenta","red", "brown", "red", "cyan", "brown", "blue", "violet","violet"},
88 blue = {"violet", "violet", "magenta","brown", "brown", "dark_green","cyan", "cyan", "cyan", "blue"},
89 cyan = {"brown", "blue", "brown", "dark_green","dark_grey", "green", "cyan", "dark_green","cyan"},
90 dark_green = {"brown", "brown", "brown", "brown", "brown", "green", "green", "dark_green"},
91 green = {"yellow", "brown", "yellow", "yellow", "dark_green","green", "green"},
92 yellow = {"orange", "red", "orange", "yellow", "orange", "yellow"},
93 brown = {"brown", "brown", "brown", "orange", "brown"},
94 orange = {"orange", "red", "orange", "orange"},
95 red = {"pink", "magenta","red"},
96 magenta = {"magenta","magenta"},
100 for one, results in pairs(mixes) do
101 for i, result in ipairs(results) do
102 local another = mixbases[i]
103 minetest.register_craft({
105 output = 'dye:' .. result .. ' 2',
106 recipe = {'dye:' .. one, 'dye:' .. another},