summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim <t4im@users.noreply.github.com>2015-01-18 22:24:18 +0100
committerTim <t4im@users.noreply.github.com>2015-01-30 05:09:20 +0100
commit00f61dfb81100094b64de06ca4e1ef73ef8bcd47 (patch)
tree061de327c6310e2358e33236a63297aa42fd14f3
parenta8b711a7f4cc22536bce1d32fd59a4903df11b13 (diff)
rewrite extractor dye recipes, adding a few dyes and making it work better with the dye mod
also preventing any issues if it is being run in a game without it
-rw-r--r--technic/machines/register/extractor_recipes.lua62
1 files changed, 51 insertions, 11 deletions
diff --git a/technic/machines/register/extractor_recipes.lua b/technic/machines/register/extractor_recipes.lua
index f752144..dffabb1 100644
--- a/technic/machines/register/extractor_recipes.lua
+++ b/technic/machines/register/extractor_recipes.lua
@@ -9,17 +9,6 @@ function technic.register_extractor_recipe(data)
end
local recipes = {
- -- Dyes
- {"technic:coal_dust", "dye:black 2"},
- {"default:cactus", "dye:green 2"},
- {"default:dry_shrub", "dye:brown 2"},
- {"flowers:geranium", "dye:blue 2"},
- {"flowers:dandelion_white", "dye:white 2"},
- {"flowers:dandelion_yellow", "dye:yellow 2"},
- {"flowers:tulip", "dye:orange 2"},
- {"flowers:rose", "dye:red 2"},
- {"flowers:viola", "dye:violet 2"},
-
-- Rubber
{"technic:raw_latex", "technic:rubber 3"},
{"moretrees:rubber_tree_trunk_empty", "technic:rubber"},
@@ -30,3 +19,54 @@ for _, data in pairs(recipes) do
technic.register_extractor_recipe({input = {data[1]}, output = data[2]})
end
+if minetest.get_modpath("dye") then
+ -- check if we are using dye or unifieddyes
+ local unifieddyes = minetest.get_modpath("unifieddyes")
+
+ -- register recipes with the same crafting ratios as `dye` provides
+ local dye_recipes = {
+ {"technic:coal_dust", "dye:black 2"},
+ {"default:grass_1", "dye:green 1"},
+ {"default:dry_shrub", "dye:brown 1"},
+ {"default:junglegrass", "dye:green 2"},
+ {"default:cactus", "dye:green 4"},
+ {"flowers:geranium", "dye:blue 4"},
+ {"flowers:dandelion_white", "dye:white 4"},
+ {"flowers:dandelion_yellow", "dye:yellow 4"},
+ {"flowers:tulip", "dye:orange 4"},
+ {"flowers:rose", "dye:red 4"},
+ {"flowers:viola", "dye:violet 4"},
+ {"bushes:blackberry", unifieddyes and "unifieddyes:magenta_s50 4" or "dye:violet 4"},
+ {"bushes:blueberry", unifieddyes and "unifieddyes:magenta_s50 4" or "dye:magenta 4"},
+ -- https://en.wikipedia.org/wiki/Catechu ancient brown dye from the wood of acacia trees
+ {"moretrees:acacia_trunk", "dye:brown 8"},
+ }
+
+ for _, data in ipairs(dye_recipes) do
+ technic.register_extractor_recipe({input = {data[1]}, output = data[2]})
+ end
+
+ -- overwrite the existing crafting recipes
+ local dyes = {"white", "red", "yellow", "blue", "violet", "orange"}
+ for _, color in ipairs(dyes) do
+ minetest.register_craft({
+ type = "shapeless",
+ output = "dye:"..color.." 1",
+ recipe = {"group:flower,color_"..color},
+ })
+
+ end
+ minetest.register_craft({
+ type = "shapeless",
+ output = "dye:black 1",
+ recipe = {"group:coal"},
+ })
+
+ if unifieddyes then
+ minetest.register_craft({
+ type = "shapeless",
+ output = "dye:green 1",
+ recipe = {"default:cactus"},
+ })
+ end
+end