42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
..
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
compat = 'grindables';
subclass = {'metallic'};
conform = {
metallic = function(m)
if m and m.data and m.data.parts and m.data.parts.powder then
return {
hardness = m.data.hardness;
value = m.value or 1, grindcost = 1;
powder = m.data.parts.powder;
}
end
end;
};
predicate = function(name)
local def = minetest.registered_items[name]._sorcery
if not def then return nil end
def = def.material
if def and def.grindvalue then
return def end
end;
};
metal = {
predicate = function(name)
-- metallookup is a table of 'primary' metal
-- items, like ingots, fragments, and powders
return sorcery.data.metallookup[name]
................................................................................
subclass = {'metal'};
predicate = function(name)
-- matreg is a registry binding crafted items,
-- like armors and tools, to the material they
-- are made out of
local mat = sorcery.matreg.lookup[name]
if mat and mat.metal then return mat end
end;
};
ore = {
groups = { 'ore' };
compat = 'ore';
predicate = function(name)
-- maybe revise this at some point once sorcery is extricated
|
>
|
|
>
>
>
>
>
>
>
>
>
>
|
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
compat = 'grindables';
subclass = {'metallic'};
conform = {
metallic = function(m)
if m and m.data and m.data.parts and m.data.parts.powder then
return {
hardness = m.data.hardness;
grindcost = 1;
grindvalue = m.value or 1;
powder = m.data.parts.powder;
}
end
end;
};
predicate = function(name)
local def = minetest.registered_items[name]._sorcery
if not def then return nil end
def = def.material
if def and def.grindvalue then
return {
hardness = def.data.hardness;
grindcost = def.grindcost or 1;
grindvalue = def.grindvalue;
powder = def.powder or def.data.parts.powder;
}
end
end;
};
metal = {
predicate = function(name)
-- metallookup is a table of 'primary' metal
-- items, like ingots, fragments, and powders
return sorcery.data.metallookup[name]
................................................................................
subclass = {'metal'};
predicate = function(name)
-- matreg is a registry binding crafted items,
-- like armors and tools, to the material they
-- are made out of
local mat = sorcery.matreg.lookup[name]
if mat and mat.metal then return mat end
local prop = minetest.registered_items[name]._sorcery
if prop and prop.material and prop.material.metal then
return prop.material
end
end;
};
ore = {
groups = { 'ore' };
compat = 'ore';
predicate = function(name)
-- maybe revise this at some point once sorcery is extricated
|