make apple blossoms only grow on trees within 20m of water by default

This commit is contained in:
Vanessa Ezekowitz 2014-07-05 01:46:33 -04:00
parent 5ca862e153
commit 7b9aac91b2
2 changed files with 4 additions and 2 deletions

View File

@ -41,8 +41,10 @@ minetest.register_abm({
chance = BLOSSOM_CHANCE, chance = BLOSSOM_CHANCE,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
if nature:is_near_water(pos) then
nature:grow_node(pos, BLOSSOM_NODE) nature:grow_node(pos, BLOSSOM_NODE)
end end
end
}) })
-- Removing blossom -- Removing blossom

View File

@ -1,6 +1,6 @@
-- Set on which distance from water can the tree still grow. -- Set on which distance from water can the tree still grow.
-- Grows anywhere if set to -1. -- Grows anywhere if set to -1.
DISTANCE_FROM_WATER = -1 DISTANCE_FROM_WATER = 20
-- Minimum light level needed to grow. Default is 8, which means daylight. -- Minimum light level needed to grow. Default is 8, which means daylight.
MINIMUM_GROWTH_LIGHT = 8 MINIMUM_GROWTH_LIGHT = 8