Zefram
2014-07-15 dd65a68ce9f494717faffc98c45814f9a9d67fa4
commit | author | age
ee0765 1
be2f30 2 local S = technic.getter
S 3
dd65a6 4 technic.register_recipe_type("grinding", { description = S("Grinding") })
ee0765 5
S 6 function technic.register_grinder_recipe(data)
7     data.time = data.time or 3
aa8af0 8     technic.register_recipe("grinding", data)
ee0765 9 end
S 10
11 local recipes = {
aa8af0 12     -- Dusts
ee0765 13     {"default:coal_lump",       "technic:coal_dust 2"},
S 14     {"default:copper_lump",     "technic:copper_dust 2"},
15     {"default:desert_stone",    "default:desert_sand"},
16     {"default:gold_lump",       "technic:gold_dust 2"},
68b7bc 17     {"default:iron_lump",       "technic:wrought_iron_dust 2"},
ee0765 18     {"technic:chromium_lump",   "technic:chromium_dust 2"},
S 19     {"technic:zinc_lump",       "technic:zinc_dust 2"},
aa8af0 20     
N 21     -- Other
22     {"default:cobble",          "default:gravel"},
23     {"default:gravel",          "default:dirt"},
24     {"default:stone",           "default:sand"},
ee0765 25 }
29429f 26
22a4bc 27 if minetest.get_modpath("moreores") then
S 28     table.insert(recipes, {"moreores:mithril_lump",   "technic:mithril_dust 2"})
29     table.insert(recipes, {"moreores:silver_lump",    "technic:silver_dust 2"})
30     table.insert(recipes, {"moreores:tin_lump",       "technic:tin_dust 2"})
31 end
32
23603e 33 if minetest.get_modpath("gloopores") or minetest.get_modpath("glooptest") then
29429f 34     table.insert(recipes, {"gloopores:alatro_lump",   "technic:alatro_dust 2"})
Z 35     table.insert(recipes, {"gloopores:kalite_lump",   "technic:kalite_dust 2"})
36     table.insert(recipes, {"gloopores:arol_lump",     "technic:arol_dust 2"})
37     table.insert(recipes, {"gloopores:talinite_lump", "technic:talinite_dust 2"})
38     table.insert(recipes, {"gloopores:akalin_lump",   "technic:akalin_dust 2"})
39 end
ee0765 40
S 41 if minetest.get_modpath("homedecor") then
42     table.insert(recipes, {"home_decor:brass_ingot", "technic:brass_dust 1"})
43 end
44
45 for _, data in pairs(recipes) do
d55ecc 46     technic.register_grinder_recipe({input = {data[1]}, output = data[2]})
ee0765 47 end
S 48
49 local function register_dust(name, ingot)
50     local lname = string.lower(name)
51     lname = string.gsub(lname, ' ', '_')
52     minetest.register_craftitem("technic:"..lname.."_dust", {
6d3196 53         description = S("%s Dust"):format(S(name)),
ee0765 54         inventory_image = "technic_"..lname.."_dust.png",
S 55         on_place_on_ground = minetest.craftitem_place_item,
56     })
57     if ingot then
58         minetest.register_craft({
59             type = "cooking",
60             recipe = "technic:"..lname.."_dust",
61             output = ingot,
62         })
d55ecc 63         technic.register_grinder_recipe({ input = {ingot}, output = "technic:"..lname.."_dust 1" })
ee0765 64     end
S 65 end
66
67 -- Sorted alphibeticaly
6d3196 68 register_dust("Brass",           "technic:brass_ingot")
N 69 register_dust("Bronze",          "default:bronze_ingot")
68b7bc 70 register_dust("Carbon Steel",    "technic:carbon_steel_ingot")
Z 71 register_dust("Cast Iron",       "technic:cast_iron_ingot")
6d3196 72 register_dust("Chromium",        "technic:chromium_ingot")
N 73 register_dust("Coal",            nil)
74 register_dust("Copper",          "default:copper_ingot")
75 register_dust("Gold",            "default:gold_ingot")
76 register_dust("Mithril",         "moreores:mithril_ingot")
77 register_dust("Silver",          "moreores:silver_ingot")
78 register_dust("Stainless Steel", "technic:stainless_steel_ingot")
79 register_dust("Tin",             "moreores:tin_ingot")
68b7bc 80 register_dust("Wrought Iron",    "technic:wrought_iron_ingot")
6d3196 81 register_dust("Zinc",            "technic:zinc_ingot")
23603e 82 if minetest.get_modpath("gloopores") or minetest.get_modpath("glooptest") then
29429f 83     register_dust("Akalin",          "glooptest:akalin_ingot")
Z 84     register_dust("Alatro",          "glooptest:alatro_ingot")
85     register_dust("Arol",            "glooptest:arol_ingot")
23603e 86     register_dust("Kalite",          nil)
29429f 87     register_dust("Talinite",        "glooptest:talinite_ingot")
Z 88 end
be2f30 89
704925 90 minetest.register_craft({
P 91     type = "fuel",
92     recipe = "technic:coal_dust",
93     burntime = 50,
94 })
be2f30 95