don't spawn apples too close together.

This commit is contained in:
Vanessa Ezekowitz 2014-07-05 01:56:06 -04:00
parent 7b9aac91b2
commit 9032385b61
1 changed files with 6 additions and 3 deletions

View File

@ -1,11 +1,12 @@
-- Blossom
local BLOSSOM_CHANCE = 15
local APPLE_CHANCE = 10
local BLOSSOM_DELAY = 3600
local BLOSSOM_NODE = "nature:blossom"
local APPLE_CHANCE = 10
local APPLE_SPREAD = 2
local function spawn_apple_under(pos)
local below = {
x = pos.x,
@ -65,6 +66,8 @@ minetest.register_abm({
chance = APPLE_CHANCE,
action = function(pos, node, active_object_count, active_object_count_wider)
spawn_apple_under(pos)
if not minetest.find_node_near(pos, APPLE_SPREAD, { "default:apple" }) then
spawn_apple_under(pos)
end
end
})