From d025784f3096bced6f0e7384b2c4d3c8a994cdac Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Sun, 15 Nov 2015 21:17:28 +0000 Subject: Speed up specific node checks --- flowers.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'flowers.lua') diff --git a/flowers.lua b/flowers.lua index 36da2e1..be1d854 100644 --- a/flowers.lua +++ b/flowers.lua @@ -16,10 +16,10 @@ minetest.register_abm({ local pos0 = {x = pos.x - 4, y = pos.y - 2, z = pos.z - 4} local pos1 = {x = pos.x + 4, y = pos.y + 2, z = pos.z + 4} - if #minetest.find_nodes_in_area(pos0, pos1, "group:flora") > 3 then + if #minetest.find_nodes_in_area_under_air(pos0, pos1, "group:flora") > 3 then - local grass = minetest.find_nodes_in_area(pos0, pos1, {"ethereal:crystalgrass"}) - local crystal = minetest.find_nodes_in_area(pos0, pos1, {"ethereal:crystal_spike"}) + local grass = minetest.find_nodes_in_area_under_air(pos0, pos1, {"ethereal:crystalgrass"}) + local crystal = minetest.find_nodes_in_area_under_air(pos0, pos1, {"ethereal:crystal_spike"}) if #grass > 6 and #crystal < 1 then grass = grass[math.random(#grass)] @@ -33,7 +33,7 @@ minetest.register_abm({ return end - local seedling = minetest.find_nodes_in_area(pos0, pos1, {"group:soil"}) + local seedling = minetest.find_nodes_in_area_under_air(pos0, pos1, {"group:soil"}) if #seedling > 0 then seedling = seedling[math.random(#seedling)] -- cgit v1.2.3