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