130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
...
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
...
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
|
local count = 0
for i=1,inv:get_size('input') do
local m = inv:get_stack('input',i)
if m:is_empty() then goto skip end
local l = sorcery.data.metallookup[m:get_name()]
if not l then
local p = sorcery.lib.tbl.walk(m:get_definition()._sorcery,{'material'})
if p.metal then l = p end
end
if not l then return false end
mix[l.id] = (mix[l.id] or 0) + l.value
count = count + l.value
::skip::end
count = math.floor(count)
-- everything is metal, we've finished summing it up.
................................................................................
drawtype = "mesh";
after_dig_node = sorcery.lib.node.purge_container;
mesh = 'sorcery-kiln-' .. state .. '.obj';
drop = id;
groups = {
cracky = (state == 'open' and 2) or nil;
sorcery_metallurgy = 1;
not_in_creative_inventory = (state == open) and nil or 1;
};
sunlight_propagates = true;
paramtype1 = 'light';
paramtype2 = 'facedir';
selection_box = box[state];
collision_box = box[state];
tiles = tex[state];
................................................................................
for _, active in pairs {false, true} do
minetest.register_node((active and id .. '_active') or id, {
_proto = kind;
description = desc;
drop = id;
after_dig_node = sorcery.lib.node.purge_container;
groups = {
cracky = (active and 2) or nil;
sorcery_metallurgy = 1;
not_in_creative_inventory = active and 1 or nil;
};
paramtype2 = 'facedir';
light_source = (active and 9) or 0;
on_construct = function(pos)
local meta = minetest.get_meta(pos)
|
|
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
...
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
...
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
|
local count = 0
for i=1,inv:get_size('input') do
local m = inv:get_stack('input',i)
if m:is_empty() then goto skip end
local l = sorcery.data.metallookup[m:get_name()]
if not l then
local p = sorcery.lib.tbl.walk(m:get_definition()._sorcery,{'material'})
if p and p.metal then l = p end
end
if not l then return false end
mix[l.id] = (mix[l.id] or 0) + l.value
count = count + l.value
::skip::end
count = math.floor(count)
-- everything is metal, we've finished summing it up.
................................................................................
drawtype = "mesh";
after_dig_node = sorcery.lib.node.purge_container;
mesh = 'sorcery-kiln-' .. state .. '.obj';
drop = id;
groups = {
cracky = (state == 'open' and 2) or nil;
sorcery_metallurgy = 1;
not_in_creative_inventory = (state == 'open') and nil or 1;
};
sunlight_propagates = true;
paramtype1 = 'light';
paramtype2 = 'facedir';
selection_box = box[state];
collision_box = box[state];
tiles = tex[state];
................................................................................
for _, active in pairs {false, true} do
minetest.register_node((active and id .. '_active') or id, {
_proto = kind;
description = desc;
drop = id;
after_dig_node = sorcery.lib.node.purge_container;
groups = {
cracky = (not active and 2) or nil;
sorcery_metallurgy = 1;
not_in_creative_inventory = active and 1 or nil;
};
paramtype2 = 'facedir';
light_source = (active and 9) or 0;
on_construct = function(pos)
local meta = minetest.get_meta(pos)
|