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