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