Added settings to enable/disable each tree type, all default to enabled.
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Sat, 6 Apr 2013 21:21:11 +0000 (17:21 -0400)
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Sat, 6 Apr 2013 21:21:11 +0000 (17:21 -0400)
init.lua
settings.lua

index 894c1c99ccc43451c9ae9b26531d43f67f973f23..c58b4196f1bb086b300ca791336cec10cd3c4d5e 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -32,20 +32,50 @@ dofile(minetest.get_modpath("moretrees").."/saplings.lua")
 
 -- tree spawning setup
 
-plantslib:register_generate_plant(moretrees.apple_tree_biome, moretrees.apple_tree_model)
-plantslib:register_generate_plant(moretrees.oak_biome, moretrees.oak_model)
-plantslib:register_generate_plant(moretrees.sequoia_biome, moretrees.sequoia_model)
-plantslib:register_generate_plant(moretrees.palm_biome, moretrees.palm_model)
-plantslib:register_generate_plant(moretrees.pine_biome, moretrees.pine_model)
-plantslib:register_generate_plant(moretrees.rubber_tree_biome, moretrees.rubber_tree_model)
-plantslib:register_generate_plant(moretrees.willow_biome, moretrees.willow_model)
-
-plantslib:register_generate_plant(moretrees.birch_biome, "moretrees:grow_birch")
-plantslib:register_generate_plant(moretrees.spruce_biome, "moretrees:grow_spruce")
-plantslib:register_generate_plant(moretrees.jungletree_biome, "moretrees:grow_jungletree")
-plantslib:register_generate_plant(moretrees.fir_biome, "moretrees:grow_fir")
-
-plantslib:register_generate_plant(moretrees.fir_biome_snow, "moretrees:grow_fir_snow")
+if moretrees.enable_apple_tree then
+       plantslib:register_generate_plant(moretrees.apple_tree_biome, moretrees.apple_tree_model)
+end
+
+if moretrees.enable_oak then
+       plantslib:register_generate_plant(moretrees.oak_biome, moretrees.oak_model)
+end
+
+if moretrees.enable_sequoia then
+       plantslib:register_generate_plant(moretrees.sequoia_biome, moretrees.sequoia_model)
+end
+
+if moretrees.enable_palm then
+       plantslib:register_generate_plant(moretrees.palm_biome, moretrees.palm_model)
+end
+
+if moretrees.enable_pine then
+       plantslib:register_generate_plant(moretrees.pine_biome, moretrees.pine_model)
+end
+
+if moretrees.enable_rubber_tree then
+       plantslib:register_generate_plant(moretrees.rubber_tree_biome, moretrees.rubber_tree_model)
+end
+
+if moretrees.enable_willow then
+       plantslib:register_generate_plant(moretrees.willow_biome, moretrees.willow_model)
+end
+
+if moretrees.enable_birch then
+       plantslib:register_generate_plant(moretrees.birch_biome, "moretrees:grow_birch")
+end
+
+if moretrees.enable_spruce then
+       plantslib:register_generate_plant(moretrees.spruce_biome, "moretrees:grow_spruce")
+end
+
+if moretrees.enable_jungle_tree then
+       plantslib:register_generate_plant(moretrees.jungletree_biome, "moretrees:grow_jungletree")
+end
+
+if moretrees.enable_fir then
+       plantslib:register_generate_plant(moretrees.fir_biome, "moretrees:grow_fir")
+       plantslib:register_generate_plant(moretrees.fir_biome_snow, "moretrees:grow_fir_snow")
+end
 
 -- Code to spawn a birch tree
 
index 1a11e88984c68ba40c580aa765f79b6a573129cb..9dfb2234904757a67612fbe1035db4fbb3f0f4ef 100644 (file)
@@ -1,9 +1,22 @@
 -- Global configuration variables
 
--- Enable replacement of default trees with beech if you want but be warned -
--- due to bugs in the speed of the engine's map generator/loader, doing so
--- will slow it WAY down.  Note:  The code that uses this variable is in
--- leafdecay.lua because of how it interacts with settings related to that
+-- Enable the various kinds of trees.
+
+moretrees.enable_apple_tree    = true
+moretrees.enable_oak           = true
+moretrees.enable_sequoia       = true
+moretrees.enable_palm          = true
+moretrees.enable_pine          = true
+moretrees.enable_rubber_tree   = true
+moretrees.enable_willow                = true
+moretrees.enable_birch         = true
+moretrees.enable_spruce                = true
+moretrees.enable_jungle_tree   = true
+moretrees.enable_fir           = true
+
+-- Enable replacement of default trees with moretrees beech.
+-- Note:  The code that uses this variable is in leafdecay.lua
+-- because of how it interacts with settings related to that
 -- function.
 
 moretrees.enable_replace_default_trees = true