sorcery  Diff

Differences From Artifact [95c6839cbe]:

To Artifact [e171bc2182]:


    16     16   	-- generates sap and hooks handlers appropriately
    17     17   	if t.node then
    18     18   		local def = minetest.registered_nodes[t.node]
    19     19   		local nextfn = def.on_place
    20     20   		minetest.override_item(t.node, { on_place = function(stack, who, pointed, ...)
    21     21   			if nextfn then nextfn(stack, who, pointed, ...) end
    22     22   			if who ~= nil and pointed.type == 'node' then
    23         -				local pos = pointed.above
    24         -				local _, counts = minetest.find_nodes_in_area(
    25         -					vector.offset(pos, -1,-1,-1),
    26         -					vector.offset(pos,  1, 1, 1),
    27         -					t.leaves or 'group:leaves', false)
    28         -				if counts[next(counts)] > 0 then
    29         -					minetest.get_meta(pos):set_int('sorcery:trunk_node_role', 1)
    30         -				end
           23  +				-- local pos = pointed.above
           24  +				-- local _, counts = minetest.find_nodes_in_area(
           25  +				-- 	vector.offset(pos, -1,-1,-1),
           26  +				-- 	vector.offset(pos,  1, 1, 1),
           27  +				-- 	t.leaves or 'group:leaves', false)
           28  +				-- if counts[next(counts)] > 0 then
           29  +				local n = minetest.get_node(pointed.above)
           30  +				n.param1 = 1
           31  +				minetest.swap_node(pointed.above, n)
           32  +				-- end
    31     33   			end
    32     34   		end })
    33     35   	end
    34     36   
    35     37   	if t.sap == false then return end
    36     38   	if not t.sapliq then
    37     39   		t.sapliq = string.format('sorcery:sap_%s', id)