Skip to content

Commit df19b4e

Browse files
committedJan 12, 2017
Dye: Simplify recipes.
Create a simple triplet table (src1, src2, dst) for all the dye recipes and group them logically, with a bit of explanation where they actually come from. This prunes a lot of recipes from the list, but the old list had a ton of combinations that did not make any sense, as well as recipes that were just gross approximations and duplicates, mixing the same color with itself just to get the same color back, which just wastes packets at logon. The list has been checked to allow all colors created from the basic dyes (flowers+coal) so that all colors can be crafted.
1 parent c8b1671 commit df19b4e

File tree

1 file changed

+34
-30
lines changed

1 file changed

+34
-30
lines changed
 

Diff for: ‎mods/dye/init.lua

+34-30
Original file line numberDiff line numberDiff line change
@@ -74,36 +74,40 @@ minetest.register_craft({
7474
})
7575

7676
-- Mix recipes
77-
-- Just mix everything to everything somehow sanely
78-
79-
local mixbases = {"pink", "magenta", "red", "orange", "brown", "yellow", "green", "dark_green", "cyan", "blue", "violet", "black", "dark_grey", "grey", "white"}
80-
81-
local mixes = {
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"},
97-
pink = {"pink"},
77+
local dye_recipes = {
78+
-- src1, src2, dst
79+
-- RYB mixes
80+
{"red", "blue", "violet"}, -- "purple"
81+
{"yellow", "red", "orange"},
82+
{"yellow", "blue", "green"},
83+
-- RYB complementary mixes
84+
{"red", "green", "dark_grey"},
85+
{"yellow", "violet", "dark_grey"},
86+
{"blue", "orange", "dark_grey"},
87+
-- CMY mixes - approximation
88+
{"cyan", "yellow", "green"},
89+
{"cyan", "magenta", "blue"},
90+
{"yellow", "magenta", "red"},
91+
-- other mixes that result in a color we have
92+
{"red", "green", "brown"},
93+
{"magenta", "blue", "violet"},
94+
{"green", "blue", "cyan"},
95+
{"pink", "violet", "magenta"},
96+
-- mixes with black
97+
{"white", "black", "grey"},
98+
{"grey", "black", "dark_grey"},
99+
{"green", "black", "dark_green"},
100+
{"orange", "black", "brown"},
101+
-- mixes with white
102+
{"white", "red", "pink"},
103+
{"white", "dark_grey", "grey"},
104+
{"white", "dark_green", "green"},
98105
}
99106

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({
104-
type = "shapeless",
105-
output = 'dye:' .. result .. ' 2',
106-
recipe = {'dye:' .. one, 'dye:' .. another},
107-
})
108-
end
107+
for _, mix in pairs(dye_recipes) do
108+
minetest.register_craft({
109+
type = "shapeless",
110+
output = 'dye:' .. mix[3] .. ' 2',
111+
recipe = {'dye:' .. mix[1], 'dye:' .. mix[2]},
112+
})
109113
end

0 commit comments

Comments
 (0)