Differences From
Artifact [45b89ab03b]:
1 1 local fragments_per_ingot = 4
2 2
3 3 minetest.register_lbm {
4 - label = "delete duranium ore";
5 - name = "sorcery:delete_duranium_ore";
4 + label = "delete duranium ore again";
5 + name = "sorcery:delete_duranium_ore_again";
6 6 nodenames = {'sorcery:stone_with_duranium'};
7 7 action = function(pos,node)
8 8 minetest.set_node(pos, {name = 'default:stone'})
9 9 end
10 10 }
11 11
12 12 sorcery.data.alloys = {}
13 +sorcery.data.kilnrecs = {}
13 14 sorcery.data.metallookup = {
14 15 -- compat bullshit
15 16 ['moreores:silver_ingot'] = {
16 17 id = 'silver'; data = sorcery.data.metals.silver;
17 18 value = fragments_per_ingot;
18 19 };
19 20 ['moreores:silver_block'] = {
................................................................................
39 40 };
40 41 }
41 42
42 43 local tools, armors = sorcery.matreg.tools, sorcery.matreg.armors
43 44 for name, metal in pairs(sorcery.data.metals) do
44 45 local ingot = metal.ingot or 'sorcery:' .. name .. '_ingot'
45 46 local block = metal.block or 'sorcery:' .. name .. '_block'
47 + local screw = 'sorcery:screw_' .. name
46 48 local fragment = 'sorcery:fragment_' .. name
47 49 if not metal.no_tools then for _,t in pairs(tools) do
48 50 sorcery.matreg.lookup[(metal.items and metal.items[t]) or ('sorcery:' .. t .. '_' .. name)] = {
49 51 metal = true;
50 52 id = name; data = metal;
51 53 }
52 54 end end
53 55 if not metal.no_armor then for _,a in pairs(armors) do
54 - sorcery.matreg.lookup[(metal.items and metal.items[t]) or ('sorcery:' .. a .. '_' .. name)] = {
56 + sorcery.matreg.lookup[(metal.items and metal.items[a]) or ('sorcery:' .. a .. '_' .. name)] = {
55 57 metal = true;
56 58 id = name; data = metal;
57 59 }
58 60 end end
59 61 sorcery.data.metallookup[ingot] = {
60 62 id = name; data = metal;
61 63 value = fragments_per_ingot;
................................................................................
63 65 sorcery.data.metallookup[block] = {
64 66 id = name; data = metal;
65 67 value = fragments_per_ingot * 9;
66 68 }
67 69 sorcery.data.metallookup[fragment] = {
68 70 id = name; data = metal;
69 71 value = 1;
72 + }
73 + sorcery.data.metallookup[screw] = {
74 + id = name; data = metal;
75 + value = 0; -- prevent use in smelting
76 + }
77 + minetest.register_craftitem(screw, {
78 + description = sorcery.lib.str.capitalize(name) .. ' screw';
79 + inventory_image = sorcery.lib.image('sorcery_screw.png'):multiply(sorcery.lib.color(metal.tone)):render();
80 + })
81 + -- TODO: replace crafting recipe with kiln recipe
82 + minetest.register_craft {
83 + output = screw.. ' 4';
84 + recipe = {
85 + {fragment,fragment,fragment};
86 + {'', fragment,''};
87 + {'', fragment,''};
88 + };
70 89 }
71 90 if not sorcery.compat.defp(ingot) then
72 91 -- TODO: remove instant_ores dependency
73 92 instant_ores.register_metal {
74 93 name = 'sorcery:' .. name;
75 94 description = sorcery.lib.str.capitalize(name);
76 95 color = sorcery.lib.color(metal.tone):hex() .. ':' .. ((metal.alpha and tostring(metal.alpha)) or '45');