sorcery  Diff

Differences From Artifact [e171bc2182]:

To Artifact [be6e1c803c]:


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
	sap = 'Sap';
	sapliq = 'sorcery:sap';
	sapling = 'default:sapling';
}
local log = sorcery.logger('tree')
local L = sorcery.lib

local measure_sap = function(v) -- v in half-pints
	return string.format('%s pints', v / 2)
end

sorcery.register.trees.foreach('sorcery:treesetup', {}, function(id, t)
	-- generates sap and hooks handlers appropriately
	if t.node then
		local def = minetest.registered_nodes[t.node]
		local nextfn = def.on_place
		minetest.override_item(t.node, { on_place = function(stack, who, pointed, ...)
			if nextfn then nextfn(stack, who, pointed, ...) end
................................................................................
		sorcery.liquid.register {
			id = t.sapliq;
			name = sapdesc;
			kind = 'sorcery:sap';
			color = t.sapcolor or t.color or {119,24,30};
			autogen = true;
			imgvariant = 'sparkle';
			measure = measure_sap;
			usetrough = t.sap ~= false;
		}
	end

end)

sorcery.tree.get = function(what)







<
<
<
<







 







|







4
5
6
7
8
9
10




11
12
13
14
15
16
17
..
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
	sap = 'Sap';
	sapliq = 'sorcery:sap';
	sapling = 'default:sapling';
}
local log = sorcery.logger('tree')
local L = sorcery.lib





sorcery.register.trees.foreach('sorcery:treesetup', {}, function(id, t)
	-- generates sap and hooks handlers appropriately
	if t.node then
		local def = minetest.registered_nodes[t.node]
		local nextfn = def.on_place
		minetest.override_item(t.node, { on_place = function(stack, who, pointed, ...)
			if nextfn then nextfn(stack, who, pointed, ...) end
................................................................................
		sorcery.liquid.register {
			id = t.sapliq;
			name = sapdesc;
			kind = 'sorcery:sap';
			color = t.sapcolor or t.color or {119,24,30};
			autogen = true;
			imgvariant = 'sparkle';
			measure = sorcery.liquid.units.pint;
			usetrough = t.sap ~= false;
		}
	end

end)

sorcery.tree.get = function(what)