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