Tim
2015-01-18 00f61dfb81100094b64de06ca4e1ef73ef8bcd47
commit | author | age
2a2358 1
N 2 local S = technic.getter
3
dd65a6 4 technic.register_recipe_type("extracting", { description = S("Extracting") })
2a2358 5
N 6 function technic.register_extractor_recipe(data)
7     data.time = data.time or 4
aa8af0 8     technic.register_recipe("extracting", data)
2a2358 9 end
N 10
11 local recipes = {
12     -- Rubber
13     {"technic:raw_latex",                 "technic:rubber 3"},
14     {"moretrees:rubber_tree_trunk_empty", "technic:rubber"},
15     {"moretrees:rubber_tree_trunk",       "technic:rubber"},
16 }
17
18 for _, data in pairs(recipes) do
d55ecc 19     technic.register_extractor_recipe({input = {data[1]}, output = data[2]})
2a2358 20 end
N 21
00f61d 22 if minetest.get_modpath("dye") then
T 23     -- check if we are using dye or unifieddyes
24     local unifieddyes = minetest.get_modpath("unifieddyes")
25
26     -- register recipes with the same crafting ratios as `dye` provides
27     local dye_recipes = {
28         {"technic:coal_dust",                 "dye:black 2"},
29         {"default:grass_1",                   "dye:green 1"},
30         {"default:dry_shrub",                 "dye:brown 1"},
31         {"default:junglegrass",               "dye:green 2"},
32         {"default:cactus",                    "dye:green 4"},
33         {"flowers:geranium",                  "dye:blue 4"},
34         {"flowers:dandelion_white",           "dye:white 4"},
35         {"flowers:dandelion_yellow",          "dye:yellow 4"},
36         {"flowers:tulip",                     "dye:orange 4"},
37         {"flowers:rose",                      "dye:red 4"},
38         {"flowers:viola",                     "dye:violet 4"},
39         {"bushes:blackberry",                 unifieddyes and "unifieddyes:magenta_s50 4" or "dye:violet 4"},
40         {"bushes:blueberry",                  unifieddyes and "unifieddyes:magenta_s50 4" or "dye:magenta 4"},
41         -- https://en.wikipedia.org/wiki/Catechu ancient brown dye from the wood of acacia trees
42         {"moretrees:acacia_trunk",            "dye:brown 8"},
43     }
44
45     for _, data in ipairs(dye_recipes) do
46         technic.register_extractor_recipe({input = {data[1]}, output = data[2]})
47     end
48
49     -- overwrite the existing crafting recipes
50     local dyes = {"white", "red", "yellow", "blue", "violet", "orange"}
51     for _, color in ipairs(dyes) do
52         minetest.register_craft({
53                 type = "shapeless",
54                 output = "dye:"..color.." 1",
55                 recipe = {"group:flower,color_"..color},
56         })
57
58     end
59     minetest.register_craft({
60         type = "shapeless",
61         output = "dye:black 1",
62         recipe = {"group:coal"},
63     })
64
65     if unifieddyes then
66         minetest.register_craft({
67             type = "shapeless",
68             output = "dye:green 1",
69             recipe = {"default:cactus"},
70         })
71     end
72 end