sorcery  Diff

Differences From Artifact [e171bc2182]:

To Artifact [be6e1c803c]:


     4      4   	sap = 'Sap';
     5      5   	sapliq = 'sorcery:sap';
     6      6   	sapling = 'default:sapling';
     7      7   }
     8      8   local log = sorcery.logger('tree')
     9      9   local L = sorcery.lib
    10     10   
    11         -local measure_sap = function(v) -- v in half-pints
    12         -	return string.format('%s pints', v / 2)
    13         -end
    14         -
    15     11   sorcery.register.trees.foreach('sorcery:treesetup', {}, function(id, t)
    16     12   	-- generates sap and hooks handlers appropriately
    17     13   	if t.node then
    18     14   		local def = minetest.registered_nodes[t.node]
    19     15   		local nextfn = def.on_place
    20     16   		minetest.override_item(t.node, { on_place = function(stack, who, pointed, ...)
    21     17   			if nextfn then nextfn(stack, who, pointed, ...) end
................................................................................
    41     37   		sorcery.liquid.register {
    42     38   			id = t.sapliq;
    43     39   			name = sapdesc;
    44     40   			kind = 'sorcery:sap';
    45     41   			color = t.sapcolor or t.color or {119,24,30};
    46     42   			autogen = true;
    47     43   			imgvariant = 'sparkle';
    48         -			measure = measure_sap;
           44  +			measure = sorcery.liquid.units.pint;
    49     45   			usetrough = t.sap ~= false;
    50     46   		}
    51     47   	end
    52     48   
    53     49   end)
    54     50   
    55     51   sorcery.tree.get = function(what)