From ef0eb4d435e81361269047b4640d2722b24be475 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sat, 6 Dec 2014 12:11:07 +0100 Subject: [PATCH] Move doc for dyes to game_api.txt --- game_api.txt | 63 +++++++++++++++++++++++++++++++++++++++++++++++ mods/dye/init.lua | 53 --------------------------------------- 2 files changed, 63 insertions(+), 53 deletions(-) diff --git a/game_api.txt b/game_api.txt index 4424b20b..8123c010 100644 --- a/game_api.txt +++ b/game_api.txt @@ -212,3 +212,66 @@ that use param2 otherwise (e.g. facedir)). If the node is in the leafdecay_drop group then it will always be dropped as an item. + +Dyes +---- +To make recipes that will work with any dye ever made by anybody, define +them based on groups. You can select any group of groups, based on your need for +amount of colors. + +#Color groups +------------- +Base color groups: +- basecolor_white +- basecolor_grey +- basecolor_black +- basecolor_red +- basecolor_yellow +- basecolor_green +- basecolor_cyan +- basecolor_blue +- basecolor_magenta + +Extended color groups (* = equal to a base color): +* excolor_white +- excolor_lightgrey +* excolor_grey +- excolor_darkgrey +* excolor_black +* excolor_red +- excolor_orange +* excolor_yellow +- excolor_lime +* excolor_green +- excolor_aqua +* excolor_cyan +- excolor_sky_blue +* excolor_blue +- excolor_violet +* excolor_magenta +- excolor_red_violet + +The whole unifieddyes palette as groups: +- unicolor_ +For the following, no white/grey/black is allowed: +- unicolor_medium_ +- unicolor_dark_ +- unicolor_light_ +- unicolor__s50 +- unicolor_medium__s50 +- unicolor_dark__s50 + +Example of one shapeless recipe using a color group: +minetest.register_craft({ + type = "shapeless", + output = ':item_yellow', + recipe = {':item_no_color', 'group:basecolor_yellow'}, +}) + +#Color lists +------------ +dye.basecolors +^ Array containing the names of available base colors + +dye.excolors +^ Array containing the names of the available extended colors diff --git a/mods/dye/init.lua b/mods/dye/init.lua index 3e827446..d7d18f7a 100644 --- a/mods/dye/init.lua +++ b/mods/dye/init.lua @@ -1,63 +1,10 @@ -- minetest/dye/init.lua --- To make recipes that will work with any dye ever made by anybody, define --- them based on groups. --- You can select any group of groups, based on your need for amount of colors. --- basecolor: 9, excolor: 17, unicolor: 89 --- --- Example of one shapeless recipe using a color group: --- Note: As this uses basecolor_*, you'd need 9 of these. --- minetest.register_craft({ --- type = "shapeless", --- output = ':item_yellow', --- recipe = {':item_no_color', 'group:basecolor_yellow'}, --- }) - -- Other mods can use these for looping through available colors 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"} --- Base color groups: --- - basecolor_white --- - basecolor_grey --- - basecolor_black --- - basecolor_red --- - basecolor_yellow --- - basecolor_green --- - basecolor_cyan --- - basecolor_blue --- - basecolor_magenta - --- Extended color groups (* = equal to a base color): --- * excolor_white --- - excolor_lightgrey --- * excolor_grey --- - excolor_darkgrey --- * excolor_black --- * excolor_red --- - excolor_orange --- * excolor_yellow --- - excolor_lime --- * excolor_green --- - excolor_aqua --- * excolor_cyan --- - excolor_sky_blue --- * excolor_blue --- - excolor_violet --- * excolor_magenta --- - excolor_red_violet - --- The whole unifieddyes palette as groups: --- - unicolor_ --- For the following, no white/grey/black is allowed: --- - unicolor_medium_ --- - unicolor_dark_ --- - unicolor_light_ --- - unicolor__s50 --- - unicolor_medium__s50 --- - unicolor_dark__s50 - -- Local stuff local dyelocal = {}