forked from minetest/minetest_game
Dye: Make pink dye mixable
Correct 2 inconsistent mixes Clean up code style and vertically align mix table Remove dyelocal and simplify table names
This commit is contained in:
parent
2fb40be409
commit
9c887e0b32
|
@ -1,15 +1,12 @@
|
||||||
-- minetest/dye/init.lua
|
|
||||||
|
|
||||||
-- Other mods can use these for looping through available colors
|
-- Other mods can use these for looping through available colors
|
||||||
|
|
||||||
dye = {}
|
dye = {}
|
||||||
dye.basecolors = {"white", "grey", "black", "red", "yellow", "green", "cyan", "blue", "magenta"}
|
dye.basecolors = {"white", "grey", "black", "red", "yellow", "green", "cyan", "blue", "magenta"}
|
||||||
dye.excolors = {"white", "lightgrey", "grey", "darkgrey", "black", "red", "orange", "yellow", "lime", "green", "aqua", "cyan", "sky_blue", "blue", "violet", "magenta", "red_violet"}
|
dye.excolors = {"white", "lightgrey", "grey", "darkgrey", "black", "red", "orange", "yellow", "lime", "green", "aqua", "cyan", "sky_blue", "blue", "violet", "magenta", "red_violet"}
|
||||||
|
|
||||||
-- Local stuff
|
-- This collection of colors is partly a historic thing, partly something else
|
||||||
local dyelocal = {}
|
|
||||||
|
|
||||||
-- This collection of colors is partly a historic thing, partly something else.
|
local dyes = {
|
||||||
dyelocal.dyes = {
|
|
||||||
{"white", "White dye", {dye=1, basecolor_white=1, excolor_white=1, unicolor_white=1}},
|
{"white", "White dye", {dye=1, basecolor_white=1, excolor_white=1, unicolor_white=1}},
|
||||||
{"grey", "Grey dye", {dye=1, basecolor_grey=1, excolor_grey=1, unicolor_grey=1}},
|
{"grey", "Grey dye", {dye=1, basecolor_grey=1, excolor_grey=1, unicolor_grey=1}},
|
||||||
{"dark_grey", "Dark grey dye", {dye=1, basecolor_grey=1, excolor_darkgrey=1, unicolor_darkgrey=1}},
|
{"dark_grey", "Dark grey dye", {dye=1, basecolor_grey=1, excolor_darkgrey=1, unicolor_darkgrey=1}},
|
||||||
|
@ -28,7 +25,8 @@ dyelocal.dyes = {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Define items
|
-- Define items
|
||||||
for _, row in ipairs(dyelocal.dyes) do
|
|
||||||
|
for _, row in ipairs(dyes) do
|
||||||
local name = row[1]
|
local name = row[1]
|
||||||
local description = row[2]
|
local description = row[2]
|
||||||
local groups = row[3]
|
local groups = row[3]
|
||||||
|
@ -45,7 +43,9 @@ for _, row in ipairs(dyelocal.dyes) do
|
||||||
recipe = {"group:flower,color_" .. name},
|
recipe = {"group:flower,color_" .. name},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
-- manually add coal->black dye
|
|
||||||
|
-- Manually add coal->black dye
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "dye:black 4",
|
output = "dye:black 4",
|
||||||
|
@ -55,29 +55,30 @@ minetest.register_craft({
|
||||||
-- Mix recipes
|
-- Mix recipes
|
||||||
-- Just mix everything to everything somehow sanely
|
-- Just mix everything to everything somehow sanely
|
||||||
|
|
||||||
dyelocal.mixbases = {"magenta", "red", "orange", "brown", "yellow", "green", "dark_green", "cyan", "blue", "violet", "black", "dark_grey", "grey", "white"}
|
local mixbases = {"pink", "magenta", "red", "orange", "brown", "yellow", "green", "dark_green", "cyan", "blue", "violet", "black", "dark_grey", "grey", "white"}
|
||||||
|
|
||||||
dyelocal.mixes = {
|
local mixes = {
|
||||||
-- magenta, red, orange, brown, yellow, green, dark_green, cyan, blue, violet, black, dark_grey, grey, white
|
-- pink, magenta, red, orange, brown, yellow, green, dark_green, cyan, blue, violet, black, dark_grey, grey, white
|
||||||
white = {"pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "violet", "grey", "grey", "white", "white"},
|
white = {"pink", "pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "violet","grey", "grey", "grey","white"},
|
||||||
grey = {"pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "pink", "dark_grey","grey", "grey"},
|
grey = {"pink", "pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "violet","dark_grey","grey", "grey"},
|
||||||
dark_grey={"brown","brown", "brown", "brown", "brown","dark_green","dark_green","blue","blue","violet","black", "black"},
|
dark_grey = {"brown", "brown", "brown", "brown", "brown", "brown", "dark_green","dark_green","blue", "blue", "violet","black", "dark_grey"},
|
||||||
black = {"black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black"},
|
black = {"black", "black", "black", "black", "black", "black", "black", "black", "black","black", "black", "black"},
|
||||||
violet= {"magenta","magenta","red", "brown", "red", "cyan", "brown", "blue", "violet","violet"},
|
violet = {"magenta","magenta","magenta","red", "brown", "red", "cyan", "brown", "blue", "violet","violet"},
|
||||||
blue = {"violet", "magenta","brown","brown","dark_green","cyan","cyan", "cyan", "blue"},
|
blue = {"violet", "violet", "magenta","brown", "brown", "dark_green","cyan", "cyan", "cyan", "blue"},
|
||||||
cyan = {"blue","brown","dark_green","dark_grey","green","cyan","dark_green","cyan"},
|
cyan = {"brown", "blue", "brown", "dark_green","dark_grey", "green", "cyan", "dark_green","cyan"},
|
||||||
dark_green={"brown","brown","brown", "brown", "green", "green", "dark_green"},
|
dark_green = {"brown", "brown", "brown", "brown", "brown", "green", "green", "dark_green"},
|
||||||
green = {"brown", "yellow","yellow","dark_green","green","green"},
|
green = {"yellow", "brown", "yellow", "yellow", "dark_green","green", "green"},
|
||||||
yellow= {"red", "orange", "yellow","orange", "yellow"},
|
yellow = {"orange", "red", "orange", "yellow", "orange", "yellow"},
|
||||||
brown = {"brown", "brown","orange", "brown"},
|
brown = {"brown", "brown", "brown", "orange", "brown"},
|
||||||
orange= {"red", "orange","orange"},
|
orange = {"orange", "red", "orange", "orange"},
|
||||||
red = {"magenta","red"},
|
red = {"pink", "magenta","red"},
|
||||||
magenta={"magenta"},
|
magenta = {"magenta","magenta"},
|
||||||
|
pink = {"pink"},
|
||||||
}
|
}
|
||||||
|
|
||||||
for one,results in pairs(dyelocal.mixes) do
|
for one, results in pairs(mixes) do
|
||||||
for i, result in ipairs(results) do
|
for i, result in ipairs(results) do
|
||||||
local another = dyelocal.mixbases[i]
|
local another = mixbases[i]
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = 'dye:' .. result .. ' 2',
|
output = 'dye:' .. result .. ' 2',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user