From 00328622d9cc38a7768a7bf449f5c52ddba666f7 Mon Sep 17 00:00:00 2001
From: ShadowNinja <noreply@gmail.com>
Date: Sat, 27 Apr 2013 19:53:12 +0200
Subject: [PATCH] Store configuration in the world directory.

---
 technic/rubber.lua |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/technic/rubber.lua b/technic/rubber.lua
index 0e530ff..6ec9731 100644
--- a/technic/rubber.lua
+++ b/technic/rubber.lua
@@ -88,14 +88,12 @@
 	end
 })
 
-minetest.register_on_generated(function(minp, maxp, blockseed)
-	if math.random(1, 100) > 5 then
-		return
-	end
-	local tmp = {x=(maxp.x-minp.x)/2+minp.x, y=(maxp.y-minp.y)/2+minp.y, z=(maxp.z-minp.z)/2+minp.z}
-	local pos = minetest.env:find_node_near(tmp, maxp.x-minp.x, {"default:dirt_with_grass"})
-	if pos ~= nil then
-			rubber_tree={
+if technic.config:getBool("enable_rubber_tree_generation") then
+	minetest.register_on_generated(function(minp, maxp, blockseed)
+		if math.random(1, 100) > 5 then
+			return
+		end
+		local rubber_tree={
 			axiom="FFFFA",
 			rules_a="[&FFBFA]////[&BFFFA]////[&FBFFA]",
 			rules_b="[&FFA]////[&FFA]////[&FFA]",
@@ -107,10 +105,14 @@
 			thin_trunks=false;
 			fruit_tree=false,
 			fruit=""
-			}
-			minetest.env:spawn_tree({x=pos.x, y=pos.y+1, z=pos.z},rubber_tree)
-	end
-end)
+		}
+		local tmp = {x=(maxp.x-minp.x)/2+minp.x, y=(maxp.y-minp.y)/2+minp.y, z=(maxp.z-minp.z)/2+minp.z}
+		local pos = minetest.env:find_node_near(tmp, maxp.x-minp.x, {"default:dirt_with_grass"})
+		if pos ~= nil then
+			minetest.env:spawn_tree({x=pos.x, y=pos.y+1, z=pos.z}, rubber_tree)
+		end
+	end)
+end
 
 
 -- ========= FUEL =========

--
Gitblit v1.8.0