2013-02-07 07:38:34 +01:00
|
|
|
--[[
|
|
|
|
|
|
|
|
Unified Dyes
|
|
|
|
|
|
|
|
This mod provides a complete dye system and framework for Minetest 0.4.x.
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
|
|
|
|
Copyright (C) 2012-2013, Vanessa Ezekowitz
|
|
|
|
Email: vanessaezekowitz@gmail.com
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
|
|
|
|
First, craft some bottles from the Vessels mod, then make some dye base:
|
|
|
|
Craft six empty bottles along with a bucket of water and a piece
|
|
|
|
of jungle grass to get 6 portions of dye base.
|
|
|
|
|
|
|
|
These craft/craftitem definitions for glass bottles are deprecated and are
|
|
|
|
only included here for backwards compatibility. Use vessels:glass_bottle
|
|
|
|
instead.
|
|
|
|
]]--
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:empty_bottle", {
|
2012-07-26 23:09:38 +02:00
|
|
|
description = "Glass Bottle (empty) (Deprecated)",
|
2012-07-24 23:56:03 +02:00
|
|
|
inventory_image = "unifieddyes_empty_bottle.png",
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
2012-07-25 03:55:35 +02:00
|
|
|
minetest.register_craft( {
|
2012-07-26 23:09:38 +02:00
|
|
|
type = "shapeless",
|
2012-08-01 02:12:00 +02:00
|
|
|
output = "vessels:glass_fragments",
|
2012-07-26 23:09:38 +02:00
|
|
|
recipe = {
|
|
|
|
"unifieddyes:empty_bottle",
|
|
|
|
"unifieddyes:empty_bottle",
|
|
|
|
},
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
2012-07-26 23:09:38 +02:00
|
|
|
-- Now the current stuff, using vessels:glass_bottle.
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:dye_base", {
|
|
|
|
description = "Uncolored Dye Base Liquid",
|
|
|
|
inventory_image = "unifieddyes_dye_base.png",
|
|
|
|
})
|
2012-07-12 23:49:46 +02:00
|
|
|
|
|
|
|
minetest.register_craft( {
|
2012-07-25 03:55:35 +02:00
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:dye_base 6",
|
|
|
|
recipe = {
|
2012-07-26 23:09:38 +02:00
|
|
|
"vessels:glass_bottle",
|
|
|
|
"vessels:glass_bottle",
|
|
|
|
"vessels:glass_bottle",
|
|
|
|
"vessels:glass_bottle",
|
|
|
|
"vessels:glass_bottle",
|
|
|
|
"vessels:glass_bottle",
|
2012-07-25 03:55:35 +02:00
|
|
|
"bucket:bucket_water",
|
|
|
|
"default:junglegrass",
|
|
|
|
},
|
|
|
|
replacements = { {'bucket:bucket_water', 'bucket:bucket_empty'}, },
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
--==========================================================================
|
|
|
|
-- Now we need to turn our color sources (flowers, etc) into pigments and from
|
|
|
|
-- there into actual usable dyes. There are seven base colors - one for each
|
|
|
|
-- flower, plus black (as "carbon black") from coal, and white (as "titanium
|
|
|
|
-- dioxide") from stone. Most give two portions of pigment; cactus gives 6,
|
|
|
|
-- stone gives 10.
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
pigments = {
|
|
|
|
"red",
|
|
|
|
"orange",
|
|
|
|
"yellow",
|
2012-08-02 01:14:49 +02:00
|
|
|
"green"
|
2012-07-24 23:56:03 +02:00
|
|
|
}
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
dyesdesc = {
|
|
|
|
"Red",
|
|
|
|
"Orange",
|
|
|
|
"Yellow",
|
2012-08-02 01:14:49 +02:00
|
|
|
"Green"
|
2012-07-24 23:56:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
colorsources = {
|
|
|
|
"flowers:flower_rose",
|
|
|
|
"flowers:flower_tulip",
|
|
|
|
"flowers:flower_dandelion_yellow",
|
|
|
|
"flowers:flower_waterlily",
|
|
|
|
}
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-08-02 01:14:49 +02:00
|
|
|
for color in ipairs(colorsources) do
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
-- the recipes to turn sources into pigments
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:pigment_"..pigments[color], {
|
2012-07-26 02:55:45 +02:00
|
|
|
description = dyesdesc[color].." Pigment",
|
2012-07-24 23:56:03 +02:00
|
|
|
inventory_image = "unifieddyes_pigment_"..pigments[color]..".png",
|
|
|
|
})
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "unifieddyes:pigment_"..pigments[color].." 2",
|
|
|
|
recipe = colorsources[color],
|
|
|
|
})
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
-- The recipes to turn pigments into usable dyes
|
|
|
|
|
|
|
|
minetest.register_craftitem("unifieddyes:"..pigments[color], {
|
2012-07-26 02:55:45 +02:00
|
|
|
description = "Full "..dyesdesc[color].." Dye",
|
2012-07-24 23:56:03 +02:00
|
|
|
inventory_image = "unifieddyes_"..pigments[color]..".png",
|
2012-07-26 02:55:45 +02:00
|
|
|
groups = { dye=1, ["basecolor_"..pigments[color]]=1, ["excolor_"..pigments[color]]=1, ["unicolor_"..pigments[color]]=1 }
|
2012-07-24 23:56:03 +02:00
|
|
|
})
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:"..pigments[color],
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:pigment_"..pigments[color],
|
|
|
|
"unifieddyes:dye_base"
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
-- Stone->titanium dioxide and cactus->green pigment are done separately
|
|
|
|
-- because of their larger yields
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:titanium_dioxide", {
|
|
|
|
description = "Titanium Dioxide",
|
|
|
|
inventory_image = "unifieddyes_titanium_dioxide.png",
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "unifieddyes:titanium_dioxide 10",
|
|
|
|
recipe = "default:stone",
|
|
|
|
})
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "unifieddyes:pigment_green 6",
|
|
|
|
recipe = "default:cactus",
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
-- coal->carbon black and carbon black -> black dye are done separately
|
|
|
|
-- because of the different names
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:carbon_black", {
|
|
|
|
description = "Carbon Black",
|
|
|
|
inventory_image = "unifieddyes_carbon_black.png",
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "unifieddyes:carbon_black 2",
|
|
|
|
recipe = "default:coal_lump",
|
|
|
|
})
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:black", {
|
2012-07-26 02:55:45 +02:00
|
|
|
description = "Black Dye",
|
2012-07-24 23:56:03 +02:00
|
|
|
inventory_image = "unifieddyes_black.png",
|
2012-07-26 03:29:08 +02:00
|
|
|
groups = { dye=1, basecolor_black=1, excolor_black=1, unicolor_black=1 }
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
2012-07-24 23:56:03 +02:00
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:black",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:carbon_black",
|
|
|
|
"unifieddyes:dye_base",
|
|
|
|
},
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
--=======================================================================
|
|
|
|
-- Now that we have the dyes in a usable form, let's mix the various
|
|
|
|
-- ingredients together to create the rest of the mod's colors and greys.
|
2012-07-12 23:49:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
----------------------------
|
|
|
|
-- The 5 levels of greyscale
|
|
|
|
|
|
|
|
-- White paint
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:white_paint",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:titanium_dioxide",
|
|
|
|
"bucket:bucket_water",
|
|
|
|
"default:junglegrass",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("unifieddyes:white_paint", {
|
|
|
|
description = "White Paint",
|
|
|
|
inventory_image = "unifieddyes_white_paint.png",
|
2012-07-26 02:55:45 +02:00
|
|
|
groups = { dye=1, basecolor_white=1, excolor_white=1, unicolor_white=1 }
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
-- Light grey paint
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:lightgrey_paint 3",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:white_paint",
|
|
|
|
"unifieddyes:white_paint",
|
2012-07-24 23:56:03 +02:00
|
|
|
"unifieddyes:carbon_black",
|
2012-07-12 23:49:46 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("unifieddyes:lightgrey_paint", {
|
2012-07-26 02:55:45 +02:00
|
|
|
description = "Light Grey Paint",
|
2012-07-12 23:49:46 +02:00
|
|
|
inventory_image = "unifieddyes_lightgrey_paint.png",
|
2012-07-26 02:55:45 +02:00
|
|
|
groups = { dye=1, excolor_lightgrey=1, unicolor_lightgrey=1 }
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
-- Medium grey paint
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:grey_paint 2",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:white_paint",
|
2012-07-24 23:56:03 +02:00
|
|
|
"unifieddyes:carbon_black",
|
2012-07-12 23:49:46 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("unifieddyes:grey_paint", {
|
2012-07-26 02:55:45 +02:00
|
|
|
description = "Medium Grey Paint",
|
2012-07-12 23:49:46 +02:00
|
|
|
inventory_image = "unifieddyes_grey_paint.png",
|
2012-07-26 02:55:45 +02:00
|
|
|
groups = { dye=1, basecolor_grey=1, excolor_grey=1, unicolor_grey=1 }
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
-- Dark grey paint
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:darkgrey_paint 3",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:white_paint",
|
2012-07-24 23:56:03 +02:00
|
|
|
"unifieddyes:carbon_black",
|
|
|
|
"unifieddyes:carbon_black",
|
2012-07-12 23:49:46 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("unifieddyes:darkgrey_paint", {
|
2012-07-26 02:55:45 +02:00
|
|
|
description = "Dark Grey Paint",
|
2012-07-12 23:49:46 +02:00
|
|
|
inventory_image = "unifieddyes_darkgrey_paint.png",
|
2012-07-26 02:55:45 +02:00
|
|
|
groups = { dye=1, excolor_darkgrey=1, unicolor_darkgrey=1 }
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
--=============================================================================
|
|
|
|
-- Smelting/crafting recipes needed to generate various remaining 'full' colors
|
|
|
|
-- (the register_craftitem functions are in the generate-the-rest loop below).
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
-- Cyan
|
|
|
|
|
2012-07-26 02:55:45 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:cyan", {
|
|
|
|
description = "Full Cyan Dye",
|
|
|
|
inventory_image = "unifieddyes_cyan.png",
|
|
|
|
groups = { dye=1, basecolor_cyan=1, excolor_cyan=1, unicolor_cyan=1 }
|
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:cyan 2",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:blue",
|
|
|
|
"unifieddyes:green",
|
|
|
|
},
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
-- Magenta
|
|
|
|
|
2012-07-26 02:55:45 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:magenta", {
|
|
|
|
description = "Full Magenta Dye",
|
|
|
|
inventory_image = "unifieddyes_magenta.png",
|
|
|
|
groups = { dye=1, basecolor_magenta=1, excolor_magenta=1, unicolor_magenta=1 }
|
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:magenta 2",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:blue",
|
|
|
|
"unifieddyes:red",
|
|
|
|
},
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
-- Lime
|
|
|
|
|
2012-07-26 02:55:45 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:lime", {
|
|
|
|
description = "Full Lime Dye",
|
|
|
|
inventory_image = "unifieddyes_lime.png",
|
|
|
|
groups = { dye=1, excolor_lime=1, unicolor_lime=1 }
|
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:lime 2",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:yellow",
|
|
|
|
"unifieddyes:green",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Aqua
|
|
|
|
|
2012-07-26 02:55:45 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:aqua", {
|
|
|
|
description = "Full Aqua Dye",
|
|
|
|
inventory_image = "unifieddyes_aqua.png",
|
|
|
|
groups = { dye=1, excolor_aqua=1, unicolor_aqua=1 }
|
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:aqua 2",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:cyan",
|
|
|
|
"unifieddyes:green",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Sky blue
|
|
|
|
|
2012-07-26 02:55:45 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:skyblue", {
|
|
|
|
description = "Full Sky-blue Dye",
|
|
|
|
inventory_image = "unifieddyes_skyblue.png",
|
|
|
|
groups = { dye=1, excolor_sky_blue=1, unicolor_sky_blue=1 }
|
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:skyblue 2",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:cyan",
|
|
|
|
"unifieddyes:blue",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2012-08-02 01:14:49 +02:00
|
|
|
-- Red-violet
|
|
|
|
|
|
|
|
minetest.register_craftitem("unifieddyes:redviolet", {
|
|
|
|
description = "Full Red-violet Dye",
|
|
|
|
inventory_image = "unifieddyes_redviolet.png",
|
|
|
|
groups = { dye=1, excolor_red_violet=1, unicolor_red_violet=1 }
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:redviolet 2",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:red",
|
|
|
|
"unifieddyes:magenta",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
-- We need to check if the version of the Flowers mod that is installed
|
|
|
|
-- contains geraniums or not. If it doesn't, use the Viola to make blue dye.
|
|
|
|
-- If Geraniums do exist, use them to make blue dye instead, and use Violas
|
|
|
|
-- to get violet dye. Violet can always be made by mixing blue with magenta
|
|
|
|
-- or red as usual.
|
|
|
|
|
|
|
|
|
|
|
|
minetest.register_craftitem("unifieddyes:pigment_blue", {
|
|
|
|
description = "Blue Pigment",
|
|
|
|
inventory_image = "unifieddyes_pigment_blue.png",
|
|
|
|
})
|
|
|
|
|
2012-08-06 05:41:22 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:blue",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:pigment_blue",
|
|
|
|
"unifieddyes:dye_base"
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2012-08-02 01:14:49 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:blue", {
|
|
|
|
description = "Full Blue Dye",
|
|
|
|
inventory_image = "unifieddyes_blue.png",
|
2012-08-20 03:05:00 +02:00
|
|
|
groups = { dye=1, basecolor_blue=1, excolor_blue=1, unicolor_blue=1 }
|
2012-08-02 01:14:49 +02:00
|
|
|
})
|
|
|
|
|
2012-07-26 02:55:45 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:violet", {
|
|
|
|
description = "Full Violet/Purple Dye",
|
|
|
|
inventory_image = "unifieddyes_violet.png",
|
|
|
|
groups = { dye=1, basecolor_violet=1, excolor_violet=1, unicolor_violet=1 }
|
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:violet 2",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:blue",
|
|
|
|
"unifieddyes:magenta",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:violet 3",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:blue",
|
|
|
|
"unifieddyes:blue",
|
|
|
|
"unifieddyes:red",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2012-08-02 01:14:49 +02:00
|
|
|
if minetest.registered_nodes["flowers:flower_geranium"] == nil then
|
2012-07-24 23:56:03 +02:00
|
|
|
|
2012-08-06 05:41:22 +02:00
|
|
|
|
2012-08-02 01:14:49 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "unifieddyes:pigment_blue 2",
|
|
|
|
recipe = "flowers:flower_viola",
|
|
|
|
})
|
|
|
|
else
|
2012-08-06 05:41:22 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:pigment_violet", {
|
|
|
|
description = "Violet Pigment",
|
|
|
|
inventory_image = "unifieddyes_pigment_violet.png",
|
|
|
|
})
|
|
|
|
|
2012-08-02 01:14:49 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "unifieddyes:pigment_blue 2",
|
|
|
|
recipe = "flowers:flower_geranium",
|
|
|
|
})
|
2012-07-26 02:55:45 +02:00
|
|
|
|
2012-08-02 01:14:49 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "unifieddyes:pigment_violet 2",
|
|
|
|
recipe = "flowers:flower_viola",
|
|
|
|
})
|
2012-08-06 05:41:22 +02:00
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:violet",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:pigment_violet",
|
|
|
|
"unifieddyes:dye_base"
|
|
|
|
}
|
|
|
|
})
|
2012-08-02 01:14:49 +02:00
|
|
|
end
|
2012-07-12 23:49:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
-- =================================================================
|
|
|
|
|
|
|
|
-- Finally, generate all of additional variants of hue, saturation, and
|
2012-07-24 23:56:03 +02:00
|
|
|
-- brightness.
|
2012-07-12 23:49:46 +02:00
|
|
|
|
|
|
|
-- "s50" in a file/item name means "saturation: 50%".
|
2012-07-16 16:53:56 +02:00
|
|
|
-- Brightness levels in the textures are 33% ("dark"), 66% ("medium"),
|
|
|
|
-- 100% ("full" but not so-named), and 150% ("light").
|
2012-07-12 23:49:46 +02:00
|
|
|
|
|
|
|
HUES = {
|
|
|
|
"red",
|
|
|
|
"orange",
|
|
|
|
"yellow",
|
|
|
|
"lime",
|
|
|
|
"green",
|
|
|
|
"aqua",
|
|
|
|
"cyan",
|
|
|
|
"skyblue",
|
|
|
|
"blue",
|
|
|
|
"violet",
|
|
|
|
"magenta",
|
|
|
|
"redviolet"
|
|
|
|
}
|
|
|
|
|
2012-07-26 02:55:45 +02:00
|
|
|
HUES2 = {
|
|
|
|
"Red",
|
|
|
|
"Orange",
|
|
|
|
"Yellow",
|
|
|
|
"Lime",
|
|
|
|
"Green",
|
|
|
|
"Aqua",
|
|
|
|
"Cyan",
|
|
|
|
"Sky-blue",
|
|
|
|
"Blue",
|
|
|
|
"Violet",
|
|
|
|
"Magenta",
|
|
|
|
"Red-violet"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-07-12 23:49:46 +02:00
|
|
|
for i = 1, 12 do
|
|
|
|
|
|
|
|
hue = HUES[i]
|
2012-07-26 02:55:45 +02:00
|
|
|
hue2 = HUES2[i]
|
2012-07-12 23:49:46 +02:00
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:dark_" .. hue .. "_s50 2",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:" .. hue,
|
|
|
|
"unifieddyes:darkgrey_paint",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:dark_" .. hue .. "_s50 4",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:" .. hue,
|
|
|
|
"unifieddyes:black",
|
|
|
|
"unifieddyes:black",
|
|
|
|
"unifieddyes:white_paint"
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:dark_" .. hue .. " 3",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:" .. hue,
|
|
|
|
"unifieddyes:black",
|
|
|
|
"unifieddyes:black",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:medium_" .. hue .. "_s50 2",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:" .. hue,
|
|
|
|
"unifieddyes:grey_paint",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:medium_" .. hue .. "_s50 3",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:" .. hue,
|
|
|
|
"unifieddyes:black",
|
|
|
|
"unifieddyes:white_paint",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:medium_" .. hue .. " 2",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:" .. hue,
|
|
|
|
"unifieddyes:black",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:" .. hue .. "_s50 2",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:" .. hue,
|
|
|
|
"unifieddyes:lightgrey_paint",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:" .. hue .. "_s50 4",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:" .. hue,
|
|
|
|
"unifieddyes:white_paint",
|
|
|
|
"unifieddyes:white_paint",
|
|
|
|
"unifieddyes:black",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2012-07-16 16:53:56 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:light_" .. hue .. " 2",
|
|
|
|
recipe = {
|
|
|
|
"unifieddyes:" .. hue,
|
|
|
|
"unifieddyes:white_paint",
|
|
|
|
},
|
2013-01-30 23:32:50 +01:00
|
|
|
replacements = { {'unifieddyes:white_paint', 'bucket:bucket_empty'}, },
|
2012-07-16 16:53:56 +02:00
|
|
|
})
|
|
|
|
|
2012-07-12 23:49:46 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:dark_" .. hue .. "_s50", {
|
2012-07-26 02:55:45 +02:00
|
|
|
description = "Dark " .. hue2 .. " Dye (low saturation)",
|
2012-07-14 05:23:39 +02:00
|
|
|
inventory_image = "unifieddyes_dark_" .. hue .. "_s50.png",
|
2012-07-26 02:55:45 +02:00
|
|
|
groups = { dye=1, ["unicolor_dark_"..hue.."_s50"]=1 }
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("unifieddyes:dark_" .. hue, {
|
2012-07-26 02:55:45 +02:00
|
|
|
description = "Dark " .. hue2 .. " Dye",
|
2012-07-14 05:23:39 +02:00
|
|
|
inventory_image = "unifieddyes_dark_" .. hue .. ".png",
|
2012-07-26 02:55:45 +02:00
|
|
|
groups = { dye=1, ["unicolor_dark_"..hue]=1 }
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("unifieddyes:medium_" .. hue .. "_s50", {
|
2012-07-26 02:55:45 +02:00
|
|
|
description = "Medium " .. hue2 .. " Dye (low saturation)",
|
2012-07-12 23:49:46 +02:00
|
|
|
inventory_image = "unifieddyes_medium_" .. hue .. "_s50.png",
|
2012-07-26 02:55:45 +02:00
|
|
|
groups = { dye=1, ["unicolor_medium_"..hue.."_s50"]=1 }
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("unifieddyes:medium_" .. hue, {
|
2012-07-26 02:55:45 +02:00
|
|
|
description = "Medium " .. hue2 .. " Dye",
|
2012-07-14 05:23:39 +02:00
|
|
|
inventory_image = "unifieddyes_medium_" .. hue .. ".png",
|
2012-07-26 02:55:45 +02:00
|
|
|
groups = { dye=1, ["unicolor_medium_"..hue]=1 }
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("unifieddyes:" .. hue .. "_s50", {
|
2012-07-26 02:55:45 +02:00
|
|
|
description = "Full " .. hue2 .. " Dye (low saturation)",
|
2012-07-14 05:23:39 +02:00
|
|
|
inventory_image = "unifieddyes_" .. hue .. "_s50.png",
|
2012-07-26 02:55:45 +02:00
|
|
|
groups = { dye=1, ["unicolor_"..hue.."_s50"]=1 }
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
2012-07-16 16:53:56 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:light_" .. hue, {
|
2012-07-26 02:55:45 +02:00
|
|
|
description = "Light " .. hue2 .. " Dye",
|
2012-07-16 16:53:56 +02:00
|
|
|
inventory_image = "unifieddyes_light_" .. hue .. ".png",
|
2012-07-26 02:55:45 +02:00
|
|
|
groups = { dye=1, ["unicolor_light_"..hue]=1 }
|
2012-07-16 16:53:56 +02:00
|
|
|
})
|
|
|
|
|
2012-07-12 23:49:46 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
print("[UnifiedDyes] Loaded!")
|
|
|
|
|