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