sorcery  Diff

Differences From Artifact [b05dd85eee]:

To Artifact [ac0bc31ba3]:


158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
...
298
299
300
301
302
303
304

305
306
307
308
309
310
311
...
375
376
377
378
379
380
381

382


383
384
385
386
387
388
389
...
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
end

local update_smelter = function(pos)
	local meta = minetest.get_meta(pos)
	local inv = meta:get_inventory()
	local proto = minetest.registered_nodes[minetest.get_node(pos).name]._proto
	local recipe, count, factor, meltpoint = find_recipe(inv)
	if recipe and proto.temp >= meltpoint then
		minetest.get_node_timer(pos):start(1)
	else
		meta:set_float('burntime',0)
	end
end

local smelter_step = function(kind,active,pos,delta)
................................................................................
		minetest.register_node(id_current, {
			_active = (state == 'closed');
			_proto = kind;
			description = desc;
			drawtype = "mesh";
			mesh = 'sorcery-kiln-' .. state .. '.obj';
			drop = id;

			sunlight_propagates = true;
			paramtype1 = 'light';
			paramtype2 = 'facedir';
			selection_box = box[state];
			collision_box = box[state];
			tiles = tex[state];
			light_source = (state == 'closed' and 7) or 0;
................................................................................
	local id = 'sorcery:smelter_' .. kind.material .. kind.size_name
	kind.id = id
	for _, active in pairs {false, true} do
		minetest.register_node((active and id .. '_active') or id, {
			_proto = kind;
			description = desc;
			drop = id;

			groups = { cracky = 2; };


			paramtype2 = 'facedir';
			light_source = (active and 9) or 0;
			on_construct = function(pos)
				local meta = minetest.get_meta(pos)
				local inv = meta:get_inventory()
				inv:set_size('input',kind.size)
				inv:set_size('output',kind.outsize)
................................................................................
		recipe = recipe;
		output = id;
	}
end

for _, t in pairs {
	{1, nil, 'clay'};
	{2, 'hot','aluminum'};
	{3, 'volcanic','platinum'};
	{4, 'stellar','duridium'};
	{5, 'nova','impervium'};
} do register_kiln {
		temp = t[1], temp_name = t[2];
		material = t[3];
		size = 3, outsize = 4, fuelsize = 1; -- future-proofing
	}

	for _, s in pairs {







|







 







>







 







>
|
>
>







 







|
|
|
|







158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
...
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
...
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
...
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
end

local update_smelter = function(pos)
	local meta = minetest.get_meta(pos)
	local inv = meta:get_inventory()
	local proto = minetest.registered_nodes[minetest.get_node(pos).name]._proto
	local recipe, count, factor, meltpoint = find_recipe(inv)
	if recipe --[[and proto.temp >= meltpoint]] then
		minetest.get_node_timer(pos):start(1)
	else
		meta:set_float('burntime',0)
	end
end

local smelter_step = function(kind,active,pos,delta)
................................................................................
		minetest.register_node(id_current, {
			_active = (state == 'closed');
			_proto = kind;
			description = desc;
			drawtype = "mesh";
			mesh = 'sorcery-kiln-' .. state .. '.obj';
			drop = id;
			groups = { cracky = 2; sorcery_device_kiln = (state == 'closed') and 1 or 2; }
			sunlight_propagates = true;
			paramtype1 = 'light';
			paramtype2 = 'facedir';
			selection_box = box[state];
			collision_box = box[state];
			tiles = tex[state];
			light_source = (state == 'closed' and 7) or 0;
................................................................................
	local id = 'sorcery:smelter_' .. kind.material .. kind.size_name
	kind.id = id
	for _, active in pairs {false, true} do
		minetest.register_node((active and id .. '_active') or id, {
			_proto = kind;
			description = desc;
			drop = id;
			groups = {
				cracky = 2;
				sorcery_device_smelter = active and 1 or 2;
			};
			paramtype2 = 'facedir';
			light_source = (active and 9) or 0;
			on_construct = function(pos)
				local meta = minetest.get_meta(pos)
				local inv = meta:get_inventory()
				inv:set_size('input',kind.size)
				inv:set_size('output',kind.outsize)
................................................................................
		recipe = recipe;
		output = id;
	}
end

for _, t in pairs {
	{1, nil, 'clay'};
	-- {2, 'hot','aluminum'};
	-- {3, 'volcanic','platinum'};
	-- {4, 'stellar','duridium'};
	-- {5, 'nova','impervium'};
} do register_kiln {
		temp = t[1], temp_name = t[2];
		material = t[3];
		size = 3, outsize = 4, fuelsize = 1; -- future-proofing
	}

	for _, s in pairs {