From 87031b60518731f62dbce0ffb1601b0c34d506c9 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Thu, 21 Jan 2016 14:59:28 +0000 Subject: Optimize code, allfaces leaves by default, leaves walkable by default --- mushroom.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mushroom.lua') diff --git a/mushroom.lua b/mushroom.lua index 39e14d2..8de756a 100644 --- a/mushroom.lua +++ b/mushroom.lua @@ -59,14 +59,16 @@ minetest.register_abm({ action = function(pos, node) if minetest.get_node_light(pos, nil) > 14 then + minetest.remove_node(pos) + return end local random = { - x = pos.x + math.random(-2,2), - y = pos.y + math.random(-1,1), - z = pos.z + math.random(-2,2) + x = pos.x + math.random(-2, 2), + y = pos.y + math.random(-1, 1), + z = pos.z + math.random(-2, 2) } local random_node = minetest.get_node_or_nil(random) -- cgit v1.2.3