Tim
2015-01-30 56e96b2593817eb77fcb51e4a81c80f4df6bb0c7
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 }
15
16 for _, data in pairs(recipes) do
d55ecc 17     technic.register_extractor_recipe({input = {data[1]}, output = data[2]})
2a2358 18 end
N 19
00f61d 20 if minetest.get_modpath("dye") then
T 21     -- check if we are using dye or unifieddyes
22     local unifieddyes = minetest.get_modpath("unifieddyes")
23
24     -- register recipes with the same crafting ratios as `dye` provides
25     local dye_recipes = {
26         {"technic:coal_dust",                 "dye:black 2"},
27         {"default:grass_1",                   "dye:green 1"},
28         {"default:dry_shrub",                 "dye:brown 1"},
29         {"default:junglegrass",               "dye:green 2"},
30         {"default:cactus",                    "dye:green 4"},
31         {"flowers:geranium",                  "dye:blue 4"},
32         {"flowers:dandelion_white",           "dye:white 4"},
33         {"flowers:dandelion_yellow",          "dye:yellow 4"},
34         {"flowers:tulip",                     "dye:orange 4"},
35         {"flowers:rose",                      "dye:red 4"},
36         {"flowers:viola",                     "dye:violet 4"},
37         {"bushes:blackberry",                 unifieddyes and "unifieddyes:magenta_s50 4" or "dye:violet 4"},
38         {"bushes:blueberry",                  unifieddyes and "unifieddyes:magenta_s50 4" or "dye:magenta 4"},
39     }
40
41     for _, data in ipairs(dye_recipes) do
42         technic.register_extractor_recipe({input = {data[1]}, output = data[2]})
43     end
44
45     -- overwrite the existing crafting recipes
46     local dyes = {"white", "red", "yellow", "blue", "violet", "orange"}
47     for _, color in ipairs(dyes) do
48         minetest.register_craft({
49                 type = "shapeless",
50                 output = "dye:"..color.." 1",
51                 recipe = {"group:flower,color_"..color},
52         })
53
54     end
55     minetest.register_craft({
56         type = "shapeless",
57         output = "dye:black 1",
58         recipe = {"group:coal"},
59     })
60
61     if unifieddyes then
62         minetest.register_craft({
63             type = "shapeless",
64             output = "dye:green 1",
65             recipe = {"default:cactus"},
66         })
67     end
68 end