Dye mod: Remove 'basecolor', 'excolor', 'unicolor' groups

This commit is contained in:
tenplus1 2018-08-23 20:39:16 +01:00 committed by Paramat
parent 689f0c5478
commit 3484ff23ad

View File

@ -1,9 +1,4 @@
-- Other mods can use these for looping through available colors
dye = {} dye = {}
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"}
-- Make dye names and descriptions available globally -- Make dye names and descriptions available globally
@ -25,42 +20,23 @@ dye.dyes = {
{"pink", "Pink"}, {"pink", "Pink"},
} }
-- This collection of colors is partly a historic thing, partly something else
local dyes = {
{"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}},
{"dark_grey", "Dark Grey Dye", {dye=1, basecolor_grey=1, excolor_darkgrey=1, unicolor_darkgrey=1}},
{"black", "Black Dye", {dye=1, basecolor_black=1, excolor_black=1, unicolor_black=1}},
{"violet", "Violet Dye", {dye=1, basecolor_magenta=1, excolor_violet=1, unicolor_violet=1}},
{"blue", "Blue Dye", {dye=1, basecolor_blue=1, excolor_blue=1, unicolor_blue=1}},
{"cyan", "Cyan Dye", {dye=1, basecolor_cyan=1, excolor_cyan=1, unicolor_cyan=1}},
{"dark_green", "Dark Green Dye", {dye=1, basecolor_green=1, excolor_green=1, unicolor_dark_green=1}},
{"green", "Green Dye", {dye=1, basecolor_green=1, excolor_green=1, unicolor_green=1}},
{"yellow", "Yellow Dye", {dye=1, basecolor_yellow=1, excolor_yellow=1, unicolor_yellow=1}},
{"brown", "Brown Dye", {dye=1, basecolor_brown=1, excolor_orange=1, unicolor_dark_orange=1}},
{"orange", "Orange Dye", {dye=1, basecolor_orange=1, excolor_orange=1, unicolor_orange=1}},
{"red", "Red Dye", {dye=1, basecolor_red=1, excolor_red=1, unicolor_red=1}},
{"magenta", "Magenta Dye", {dye=1, basecolor_magenta=1, excolor_red_violet=1, unicolor_red_violet=1}},
{"pink", "Pink Dye", {dye=1, basecolor_red=1, excolor_red=1, unicolor_light_red=1}},
}
-- Define items -- Define items
for _, row in ipairs(dyes) do for _, row in ipairs(dye.dyes) do
local name = row[1] local name = row[1]
local description = row[2] local description = row[2]
local groups = row[3] local groups = {dye = 1}
local item_name = "dye:" .. name groups["color_" .. name] = 1
local item_image = "dye_" .. name .. ".png"
minetest.register_craftitem(item_name, { minetest.register_craftitem("dye:" .. name, {
inventory_image = item_image, inventory_image = "dye_" .. name .. ".png",
description = description, description = description .. " Dye",
groups = groups groups = groups
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = item_name .. " 4", output = "dye:" .. name .. " 4",
recipe = {"group:flower,color_" .. name}, recipe = {"group:flower,color_" .. name},
}) })
end end
@ -74,6 +50,7 @@ minetest.register_craft({
}) })
-- Mix recipes -- Mix recipes
local dye_recipes = { local dye_recipes = {
-- src1, src2, dst -- src1, src2, dst
-- RYB mixes -- RYB mixes