configurable tree growth light level

Allow the tree's min light level for growth to be configurable in the config, but default to 13 if not defined.
This commit is contained in:
Ryan 2015-11-11 12:26:20 +00:00
parent e67e28d226
commit d248261faf

View file

@ -17,7 +17,8 @@ local function can_grow(pos)
return false
end
local light_level = minetest.get_node_light(pos)
if not light_level or light_level < 13 then
local min_light_level = tonumber(minetest.setting_get("trees_min_light_level")) or 13
if not light_level or light_level < min_light_level then
return false
end
return true