From 9032385b61ca18e867dab2dd009388473dd1be1e Mon Sep 17 00:00:00 2001
From: Vanessa Ezekowitz <vanessaezekowitz@gmail.com>
Date: Sat, 5 Jul 2014 01:56:06 -0400
Subject: [PATCH] don't spawn apples too close together.

---
 nature_classic/blossom.lua | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/nature_classic/blossom.lua b/nature_classic/blossom.lua
index ca7d011..81a173f 100644
--- a/nature_classic/blossom.lua
+++ b/nature_classic/blossom.lua
@@ -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
 })