Tim
2015-01-30 56e96b2593817eb77fcb51e4a81c80f4df6bb0c7
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"},
b0faa7 19     {"technic:uranium_lump",    "technic:uranium_dust 2"},
ee0765 20     {"technic:zinc_lump",       "technic:zinc_dust 2"},
aa8af0 21     
N 22     -- Other
23     {"default:cobble",          "default:gravel"},
24     {"default:gravel",          "default:dirt"},
25     {"default:stone",           "default:sand"},
a8c097 26     {"default:sandstone",       "default:sand 2"}, -- reverse recipe can be found in the compressor
ee0765 27 }
29429f 28
a8c097 29 -- defuse the sandstone -> 4 sand recipe to avoid infinite sand bugs (also consult the inverse compressor recipe)
T 30 minetest.register_craft({
31     output = "default:sandstone",
32     recipe = {
33         {'default:sandstone'}
34     },
35 })
36
a8b711 37 if minetest.get_modpath("farming") then
T 38     table.insert(recipes, {"farming:seed_wheat",   "farming:flour 1"})
39 end
40
22a4bc 41 if minetest.get_modpath("moreores") then
S 42     table.insert(recipes, {"moreores:mithril_lump",   "technic:mithril_dust 2"})
43     table.insert(recipes, {"moreores:silver_lump",    "technic:silver_dust 2"})
44     table.insert(recipes, {"moreores:tin_lump",       "technic:tin_dust 2"})
45 end
46
23603e 47 if minetest.get_modpath("gloopores") or minetest.get_modpath("glooptest") then
29429f 48     table.insert(recipes, {"gloopores:alatro_lump",   "technic:alatro_dust 2"})
Z 49     table.insert(recipes, {"gloopores:kalite_lump",   "technic:kalite_dust 2"})
50     table.insert(recipes, {"gloopores:arol_lump",     "technic:arol_dust 2"})
51     table.insert(recipes, {"gloopores:talinite_lump", "technic:talinite_dust 2"})
52     table.insert(recipes, {"gloopores:akalin_lump",   "technic:akalin_dust 2"})
53 end
ee0765 54
S 55 if minetest.get_modpath("homedecor") then
56     table.insert(recipes, {"home_decor:brass_ingot", "technic:brass_dust 1"})
57 end
58
59 for _, data in pairs(recipes) do
d55ecc 60     technic.register_grinder_recipe({input = {data[1]}, output = data[2]})
ee0765 61 end
S 62
3cc568 63 -- defuse common grinder unfriendly recipes
T 64 if minetest.get_modpath("fake_fire") then -- from homedecor_modpack
65     minetest.register_craft({ output='default:cobble', recipe={{'default:cobble'}}})
66     minetest.register_craft({ output='default:gravel', recipe={{'default:gravel'}}})
67 end
68
69 -- dusts
ee0765 70 local function register_dust(name, ingot)
S 71     local lname = string.lower(name)
72     lname = string.gsub(lname, ' ', '_')
73     minetest.register_craftitem("technic:"..lname.."_dust", {
6d3196 74         description = S("%s Dust"):format(S(name)),
ee0765 75         inventory_image = "technic_"..lname.."_dust.png",
S 76         on_place_on_ground = minetest.craftitem_place_item,
77     })
78     if ingot then
79         minetest.register_craft({
80             type = "cooking",
81             recipe = "technic:"..lname.."_dust",
82             output = ingot,
83         })
d55ecc 84         technic.register_grinder_recipe({ input = {ingot}, output = "technic:"..lname.."_dust 1" })
ee0765 85     end
S 86 end
87
88 -- Sorted alphibeticaly
6d3196 89 register_dust("Brass",           "technic:brass_ingot")
N 90 register_dust("Bronze",          "default:bronze_ingot")
68b7bc 91 register_dust("Carbon Steel",    "technic:carbon_steel_ingot")
Z 92 register_dust("Cast Iron",       "technic:cast_iron_ingot")
6d3196 93 register_dust("Chromium",        "technic:chromium_ingot")
N 94 register_dust("Coal",            nil)
95 register_dust("Copper",          "default:copper_ingot")
96 register_dust("Gold",            "default:gold_ingot")
97 register_dust("Mithril",         "moreores:mithril_ingot")
98 register_dust("Silver",          "moreores:silver_ingot")
99 register_dust("Stainless Steel", "technic:stainless_steel_ingot")
100 register_dust("Tin",             "moreores:tin_ingot")
68b7bc 101 register_dust("Wrought Iron",    "technic:wrought_iron_ingot")
6d3196 102 register_dust("Zinc",            "technic:zinc_ingot")
23603e 103 if minetest.get_modpath("gloopores") or minetest.get_modpath("glooptest") then
29429f 104     register_dust("Akalin",          "glooptest:akalin_ingot")
Z 105     register_dust("Alatro",          "glooptest:alatro_ingot")
106     register_dust("Arol",            "glooptest:arol_ingot")
23603e 107     register_dust("Kalite",          nil)
29429f 108     register_dust("Talinite",        "glooptest:talinite_ingot")
Z 109 end
be2f30 110
b0faa7 111 for p = 0, 35 do
Z 112     local nici = (p ~= 0 and p ~= 7 and p ~= 35) and 1 or nil
113     local psuffix = p == 7 and "" or p
114     local ingot = "technic:uranium"..psuffix.."_ingot"
115     local dust = "technic:uranium"..psuffix.."_dust"
116     minetest.register_craftitem(dust, {
117         description = S("%s Dust"):format(string.format(S("%.1f%%-Fissile Uranium"), p/10)),
118         inventory_image = "technic_uranium_dust.png",
119         on_place_on_ground = minetest.craftitem_place_item,
120         groups = {uranium_dust=1, not_in_creative_inventory=nici},
121     })
122     minetest.register_craft({
123         type = "cooking",
124         recipe = dust,
125         output = ingot,
126     })
127     technic.register_grinder_recipe({ input = {ingot}, output = dust })
128 end
129
130 local function uranium_dust(p)
131     return "technic:uranium"..(p == 7 and "" or p).."_dust"
132 end
133 for pa = 0, 34 do
134     for pb = pa+1, 35 do
135         local pc = (pa+pb)/2
136         if pc == math.floor(pc) then
137             minetest.register_craft({
138                 type = "shapeless",
139                 recipe = { uranium_dust(pa), uranium_dust(pb) },
140                 output = uranium_dust(pc).." 2",
141             })
142         end
143     end
144 end
145
704925 146 minetest.register_craft({
P 147     type = "fuel",
148     recipe = "technic:coal_dust",
149     burntime = 50,
150 })
be2f30 151
2e0437 152 if minetest.get_modpath("gloopores") or minetest.get_modpath("glooptest") then
T 153     minetest.register_craft({
154         type = "fuel",
155         recipe = "technic:kalite_dust",
156         burntime = 37.5,
157     })
158 end