Default/trees: Add requirement of light level 13 for sapling growth
authorparamat <mat.gregory@virginmedia.com>
Fri, 16 Oct 2015 10:51:27 +0000 (11:51 +0100)
committerparamat <mat.gregory@virginmedia.com>
Sat, 17 Oct 2015 08:41:17 +0000 (09:41 +0100)
mods/default/trees.lua

index 07cc4d73752c8c537de84f764573ddb4f69d3b62..5f50b040a36b68b7258f2add92cf7ba89b76e7d3 100644 (file)
@@ -16,6 +16,10 @@ local function can_grow(pos)
        if is_soil == 0 then
                return false
        end
+       local ll = minetest.get_node_light(pos)
+       if not ll or ll < 13 then -- Minimum light level for growth
+               return false          -- matches grass, wheat and cotton
+       end
        return true
 end