@@ -1,6 +1,7 @@ local log = sorcery.logger('tap') local sap_interval = 60; +local L=sorcery.lib local function tapdrip(liq, pos) return sorcery.vfx.drip(liq, vector.offset(pos, 0, -0.3, 0), math.random(5,12), sap_interval, 2) end @@ -38,9 +39,9 @@ name = 'sorcery:tap'; param2 = minetest.dir_to_wallmounted(vector.subtract(where.under,where.above)) }) - if sorcery.lib.node.tree_is_live(where.under) then + if L.node.tree_is_live(where.under) then -- start dripping immediately to indicate the tree is alive tapdrip(tree.def.sapliq, where.above) end @@ -89,9 +90,9 @@ local tnode = minetest.get_node(tpos) if tnode.name == 'air' then return end --pathological case local tree for id,t in pairs(sorcery.data.trees) do - if t.node == tnode.name then + if L.tbl.strmatch(t.node, tnode.name) then tree = t goto found end end do @@ -108,9 +109,9 @@ mass_trunk = c.mass_trunk prevalidate = true else local tbody - live, tbody = sorcery.lib.node.tree_is_live(tpos) + live, tbody = L.node.tree_is_live(tpos) if live then should_cache = tbody.nodes[tbody.trunk] -- mass_leaves = #(tbody.nodes[tbody.leaves]) mass_trunk = #(tbody.nodes[tbody.trunk]) * 12 @@ -143,9 +144,9 @@ -- FIXME for i=1,8 do local at = vector.offset(pos, 0,-i,0) - if sorcery.lib.node.is_air(at) then goto skip end + if L.node.is_air(at) then goto skip end local trough = minetest.get_node(at) if minetest.get_item_group(trough.name, 'sorcery_trough') ~= 0 then local n = minetest.registered_nodes[trough.name]