Papyrus, cactus: Require light level 13 for growth
authorSmallJoker <mk939@ymail.com>
Tue, 27 Dec 2016 15:18:49 +0000 (16:18 +0100)
committerparamat <mat.gregory@virginmedia.com>
Mon, 2 Jan 2017 18:30:05 +0000 (18:30 +0000)
mods/default/functions.lua

index 3bda4bf036f487d09bf73b845ad50442aa0c2638..11c42d5928877b5b34ac7188ec082d4c2b99ac04 100644 (file)
@@ -186,6 +186,9 @@ function default.grow_cactus(pos, node)
        if height == 4 or node.name ~= "air" then
                return
        end
+       if minetest.get_node_light(pos) < 13 then
+               return
+       end
        minetest.set_node(pos, {name = "default:cactus"})
        return true
 end
@@ -209,6 +212,9 @@ function default.grow_papyrus(pos, node)
        if height == 4 or node.name ~= "air" then
                return
        end
+       if minetest.get_node_light(pos) < 13 then
+               return
+       end
        minetest.set_node(pos, {name = "default:papyrus"})
        return true
 end