diff --git a/bottle-9-pack.png b/bottle-9-pack.png new file mode 100644 index 0000000..0de6960 Binary files /dev/null and b/bottle-9-pack.png differ diff --git a/craft-red-dye.png b/craft-red-dye.png new file mode 100644 index 0000000..1fa2d26 Binary files /dev/null and b/craft-red-dye.png differ diff --git a/dye-base.png b/dye-base.png new file mode 100644 index 0000000..b74da03 Binary files /dev/null and b/dye-base.png differ diff --git a/init.lua b/init.lua index ce946a2..909978c 100644 --- a/init.lua +++ b/init.lua @@ -1,60 +1,278 @@ --- Unified Dyes Mod by Vanessa Ezekowitz ~~ 2012-07-08 +-- Unified Dyes Mod by Vanessa Ezekowitz ~~ 2012-07-24 -- -- License: GPL -- -- This mod depends on ironzorg's flowers mod -- ---================================================================= --- Smelting/crafting recipes needed to generate various base colors --- (the register_craftitem functions are in the generate-the-rest --- loop below the base colors). +--=========================================================================== +-- First you need something to put the dyes into - glass bottles +-- +-- Smelt some sand into glass as usual, then smelt one of the resulting glass +-- blocks to get a 9-pack of empty bottles. ------------------ --- Primary colors - --- Red (rose) - -minetest.register_craft({ - type = "cooking", - output = "unifieddyes:red 2", - recipe = "flowers:flower_rose", +minetest.register_craftitem("unifieddyes:empty_bottle", { + description = "Empty Glass Bottle", + inventory_image = "unifieddyes_empty_bottle.png", }) --- Green (cactus) - -minetest.register_craft({ - type = "cooking", - output = "unifieddyes:green 2", - recipe = "default:cactus", +minetest.register_craftitem("unifieddyes:bottle_9_pack", { + description = "Empty Glass Bottles (9-pack)", + inventory_image = "unifieddyes_bottle_9_pack.png", }) minetest.register_craft({ type = "cooking", - output = "unifieddyes:green 2", - recipe = "flowers:flower_waterlily", + output = "unifieddyes:bottle_9_pack", + recipe = "default:glass", +}) + +-- The use of this mod will, if the mods that depend on it are written +-- correctly, generate lots of empty bottles, so let's recycle them. + +-- First, pack them into a 9-pack unit by placing one into each of the 9 +-- crafting slots. + +minetest.register_craft( { + output = "unifieddyes:bottle_9_pack", + recipe = { + { "unifieddyes:empty_bottle", "unifieddyes:empty_bottle", "unifieddyes:empty_bottle" }, + { "unifieddyes:empty_bottle", "unifieddyes:empty_bottle", "unifieddyes:empty_bottle" }, + { "unifieddyes:empty_bottle", "unifieddyes:empty_bottle", "unifieddyes:empty_bottle" }, + }, +}) + +-- then smelt the 9-pack back into a glass block: + +minetest.register_craft({ + type = "cooking", + output = "default:glass", + recipe = "unifieddyes:bottle_9_pack", +}) + +-- Now, once you have a 9-pack of bottles, craft it with one bucket of water +-- and a piece of jungle grass to get 9 individual portions of the liquid dye +-- base and an empty bucket: + +minetest.register_craftitem("unifieddyes:dye_base", { + description = "Uncolored Dye Base Liquid", + inventory_image = "unifieddyes_dye_base.png", }) minetest.register_craft( { type = "shapeless", - output = "unifieddyes:green 2", + output = "unifieddyes:dye_base 9", recipe = { - "unifieddyes:blue", - "unifieddyes:yellow", + "bucket:bucket_water", + "default:junglegrass", + "unifieddyes:bottle_9_pack", + }, + replacements = { {'bucket:bucket_water', 'bucket:bucket_empty'}, }, +}) + +--========================================================================== +-- 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. + +pigments = { + "red", + "orange", + "yellow", + "green", + "blue", + "carbon_black", +} + +pigmentsdesc = { + "Red", + "Orange", + "Yellow", + "Green", + "Blue", +} + +dyesdesc = { + "Red", + "Orange", + "Yellow", + "Green", + "Blue", +} + +colorsources = { + "flowers:flower_rose", + "flowers:flower_tulip", + "flowers:flower_dandelion_yellow", + "flowers:flower_waterlily", + "flowers:flower_viola", +} + +for color = 1, 5 do + + -- the recipes to turn sources into pigments + + minetest.register_craftitem("unifieddyes:pigment_"..pigments[color], { + description = pigmentsdesc[color].." Pigment", + inventory_image = "unifieddyes_pigment_"..pigments[color]..".png", + }) + + minetest.register_craft({ + type = "cooking", + output = "unifieddyes:pigment_"..pigments[color].." 2", + recipe = colorsources[color], + }) + + -- The recipes to turn pigments into usable dyes + + minetest.register_craftitem("unifieddyes:"..pigments[color], { + description = dyesdesc[color].." Dye", + inventory_image = "unifieddyes_"..pigments[color]..".png", + }) + + minetest.register_craft( { + type = "shapeless", + output = "unifieddyes:"..pigments[color], + recipe = { + "unifieddyes:pigment_"..pigments[color], + "unifieddyes:dye_base" + } + }) +end + +-- Stone->titanium dioxide and cactus->green pigment are done separately +-- because of their larger yields + +minetest.register_craftitem("unifieddyes:titanium_dioxide", { + description = "Titanium Dioxide", + inventory_image = "unifieddyes_titanium_dioxide.png", +}) + +minetest.register_craft({ + type = "cooking", + output = "unifieddyes:titanium_dioxide 10", + recipe = "default:stone", +}) + +minetest.register_craft({ + type = "cooking", + output = "unifieddyes:pigment_green 6", + recipe = "default:cactus", +}) + +-- coal->carbon black and carbon black -> black dye are done separately +-- because of the different names + +minetest.register_craftitem("unifieddyes:carbon_black", { + description = "Carbon Black", + inventory_image = "unifieddyes_carbon_black.png", +}) + +minetest.register_craft({ + type = "cooking", + output = "unifieddyes:carbon_black 2", + recipe = "default:coal_lump", +}) + +minetest.register_craftitem("unifieddyes:black", { + description = "Carbon Black", + inventory_image = "unifieddyes_black.png", +}) + +minetest.register_craft( { + type = "shapeless", + output = "unifieddyes:black", + recipe = { + "unifieddyes:carbon_black", + "unifieddyes:dye_base", + }, +}) + +--======================================================================= +-- 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. + + +---------------------------- +-- 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", + groups = {dye=1}, +}) + +-- Light grey paint + +minetest.register_craft( { + type = "shapeless", + output = "unifieddyes:lightgrey_paint 3", + recipe = { + "unifieddyes:white_paint", + "unifieddyes:white_paint", + "unifieddyes:carbon_black", }, }) --- Blue (Viola) +minetest.register_craftitem("unifieddyes:lightgrey_paint", { + description = "Light grey paint", + inventory_image = "unifieddyes_lightgrey_paint.png", + groups = {dye=1}, +}) -minetest.register_craft({ - type = "cooking", - output = "unifieddyes:blue 2", - recipe = "flowers:flower_viola", +-- Medium grey paint + +minetest.register_craft( { + type = "shapeless", + output = "unifieddyes:grey_paint 2", + recipe = { + "unifieddyes:white_paint", + "unifieddyes:carbon_black", + }, +}) + +minetest.register_craftitem("unifieddyes:grey_paint", { + description = "Medium grey paint", + inventory_image = "unifieddyes_grey_paint.png", + groups = {dye=1}, +}) + +-- Dark grey paint + +minetest.register_craft( { + type = "shapeless", + output = "unifieddyes:darkgrey_paint 3", + recipe = { + "unifieddyes:white_paint", + "unifieddyes:carbon_black", + "unifieddyes:carbon_black", + }, +}) + +minetest.register_craftitem("unifieddyes:darkgrey_paint", { + description = "Dark grey paint", + inventory_image = "unifieddyes_darkgrey_paint.png", + groups = {dye=1}, }) -------------------- --- Secondary colors +--============================================================================= +-- Smelting/crafting recipes needed to generate various remaining 'full' colors +-- (the register_craftitem functions are in the generate-the-rest loop below). -- Cyan @@ -78,36 +296,6 @@ minetest.register_craft( { }, }) --- Yellow (yellow dandelion) - -minetest.register_craft({ - type = "cooking", - output = "unifieddyes:yellow 2", - recipe = "flowers:flower_dandelion_yellow", -}) - - ------------------- --- Tertiary colors - --- Orange (tulip) - -minetest.register_craft({ - type = "cooking", - output = "unifieddyes:orange 2", - recipe = "flowers:flower_tulip", -}) - -minetest.register_craft( { - type = "shapeless", - output = "unifieddyes:orange 2", - recipe = { - "unifieddyes:yellow", - "unifieddyes:red", - }, -}) - - -- Lime minetest.register_craft( { @@ -174,116 +362,11 @@ minetest.register_craft( { }, }) ----------------------------- --- The 5 levels of greyscale - --- White paint - -minetest.register_craftitem("unifieddyes:titanium_dioxide", { - description = "Titanium Dioxide Powder", - inventory_image = "unifieddyes_titanium_dioxide.png", - groups = {dye=1}, -}) - -minetest.register_craft({ - type = "cooking", - output = "unifieddyes:titanium_dioxide 10", - recipe = "default:stone", -}) - -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", - groups = {dye=1}, -}) - - --- Light grey paint - -minetest.register_craft( { - type = "shapeless", - output = "unifieddyes:lightgrey_paint 3", - recipe = { - "unifieddyes:white_paint", - "unifieddyes:white_paint", - "unifieddyes:black", - }, -}) - -minetest.register_craftitem("unifieddyes:lightgrey_paint", { - description = "Light grey paint", - inventory_image = "unifieddyes_lightgrey_paint.png", - groups = {dye=1}, -}) - - --- Medium grey paint - -minetest.register_craft( { - type = "shapeless", - output = "unifieddyes:grey_paint 2", - recipe = { - "unifieddyes:white_paint", - "unifieddyes:black", - }, -}) - -minetest.register_craftitem("unifieddyes:grey_paint", { - description = "Medium grey paint", - inventory_image = "unifieddyes_grey_paint.png", - groups = {dye=1}, -}) - - --- Dark grey paint - -minetest.register_craft( { - type = "shapeless", - output = "unifieddyes:darkgrey_paint 3", - recipe = { - "unifieddyes:white_paint", - "unifieddyes:black", - "unifieddyes:black", - }, -}) - -minetest.register_craftitem("unifieddyes:darkgrey_paint", { - description = "Dark grey paint", - inventory_image = "unifieddyes_darkgrey_paint.png", - groups = {dye=1}, -}) - - --- Black dye (coal) - -minetest.register_craft({ - type = "cooking", - output = "unifieddyes:black 2", - recipe = "default:coal_lump", -}) - -minetest.register_craftitem("unifieddyes:black", { - description = "Black Dye", - inventory_image = "unifieddyes_black.png", - groups = {dye=1}, -}) - - -- ================================================================= -- Finally, generate all of additional variants of hue, saturation, and --- brightness from the above 12 base colors. +-- brightness. -- "s50" in a file/item name means "saturation: 50%". -- Brightness levels in the textures are 33% ("dark"), 66% ("medium"), @@ -440,5 +523,6 @@ for i = 1, 12 do end + print("[UnifiedDyes] Loaded!") diff --git a/textures/unifieddyes_bottle_9_pack.png b/textures/unifieddyes_bottle_9_pack.png new file mode 100644 index 0000000..3be2671 Binary files /dev/null and b/textures/unifieddyes_bottle_9_pack.png differ diff --git a/textures/unifieddyes_carbon_black.png b/textures/unifieddyes_carbon_black.png new file mode 100644 index 0000000..4a13627 Binary files /dev/null and b/textures/unifieddyes_carbon_black.png differ diff --git a/textures/unifieddyes_dye_base.png b/textures/unifieddyes_dye_base.png new file mode 100644 index 0000000..6cc7290 Binary files /dev/null and b/textures/unifieddyes_dye_base.png differ diff --git a/textures/unifieddyes_empty_bottle.png b/textures/unifieddyes_empty_bottle.png new file mode 100644 index 0000000..0129bea Binary files /dev/null and b/textures/unifieddyes_empty_bottle.png differ diff --git a/textures/unifieddyes_pigment_blue.png b/textures/unifieddyes_pigment_blue.png new file mode 100644 index 0000000..a85a15b Binary files /dev/null and b/textures/unifieddyes_pigment_blue.png differ diff --git a/textures/unifieddyes_pigment_green.png b/textures/unifieddyes_pigment_green.png new file mode 100644 index 0000000..3fa7b03 Binary files /dev/null and b/textures/unifieddyes_pigment_green.png differ diff --git a/textures/unifieddyes_pigment_orange.png b/textures/unifieddyes_pigment_orange.png new file mode 100644 index 0000000..36efdfc Binary files /dev/null and b/textures/unifieddyes_pigment_orange.png differ diff --git a/textures/unifieddyes_pigment_red.png b/textures/unifieddyes_pigment_red.png new file mode 100644 index 0000000..37775b5 Binary files /dev/null and b/textures/unifieddyes_pigment_red.png differ diff --git a/textures/unifieddyes_pigment_yellow.png b/textures/unifieddyes_pigment_yellow.png new file mode 100644 index 0000000..f22b8b6 Binary files /dev/null and b/textures/unifieddyes_pigment_yellow.png differ diff --git a/unifieddyes1.png b/unifieddyes1.png index 5a01cc1..0cd2a7b 100644 Binary files a/unifieddyes1.png and b/unifieddyes1.png differ