Working on adding a whole new set of trees to the mod
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Sat, 19 Jan 2013 23:36:13 +0000 (18:36 -0500)
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Sun, 20 Jan 2013 04:26:16 +0000 (23:26 -0500)
Most of the added code written by RealBadAngel
Also adds a couple of additional biome controls to jungle trees and conifers.
Also adds a text file describing the biome settings in a human-readable manner.

At present, this doesn't actually add anything new, it just refactors the
code to allow for more trees, and adds a bunch of biome definitions, tree
models, textures, etc. but no code to use them, yet.

60 files changed:
README.md
biome_defs.lua [new file with mode: 0644]
init.lua
node_defs.lua [new file with mode: 0644]
textures/moretrees_acorn.png [new file with mode: 0644]
textures/moretrees_apple_tree.png [new file with mode: 0644]
textures/moretrees_apple_tree_leaves.png [new file with mode: 0644]
textures/moretrees_apple_tree_sapling.png [new file with mode: 0644]
textures/moretrees_apple_tree_top.png [new file with mode: 0644]
textures/moretrees_apple_tree_wood.png [new file with mode: 0644]
textures/moretrees_beech.png [new file with mode: 0755]
textures/moretrees_beech_leaves.png [new file with mode: 0755]
textures/moretrees_beech_sapling.png [new file with mode: 0644]
textures/moretrees_beech_top.png [new file with mode: 0755]
textures/moretrees_beech_wood.png [new file with mode: 0644]
textures/moretrees_birch.png [new file with mode: 0644]
textures/moretrees_birch_leaves.png [new file with mode: 0644]
textures/moretrees_birch_sapling.png [new file with mode: 0644]
textures/moretrees_birch_top.png [new file with mode: 0644]
textures/moretrees_birch_wood.png [new file with mode: 0644]
textures/moretrees_coconut.png [new file with mode: 0644]
textures/moretrees_oak.png [new file with mode: 0644]
textures/moretrees_oak_leaves.png [new file with mode: 0644]
textures/moretrees_oak_sapling.png [new file with mode: 0644]
textures/moretrees_oak_top.png [new file with mode: 0644]
textures/moretrees_oak_wood.png [new file with mode: 0644]
textures/moretrees_palm.png [new file with mode: 0644]
textures/moretrees_palm_leaves.png [new file with mode: 0644]
textures/moretrees_palm_sapling.png [new file with mode: 0644]
textures/moretrees_palm_top.png [new file with mode: 0644]
textures/moretrees_palm_wood.png [new file with mode: 0644]
textures/moretrees_pine.png [new file with mode: 0644]
textures/moretrees_pine_cone.png [new file with mode: 0644]
textures/moretrees_pine_leaves.png [new file with mode: 0644]
textures/moretrees_pine_sapling.png [new file with mode: 0644]
textures/moretrees_pine_top.png [new file with mode: 0644]
textures/moretrees_pine_wood.png [new file with mode: 0644]
textures/moretrees_rubber_tree.png [new file with mode: 0644]
textures/moretrees_rubber_tree_leaves.png [new file with mode: 0644]
textures/moretrees_rubber_tree_sapling.png [new file with mode: 0644]
textures/moretrees_rubber_tree_top.png [new file with mode: 0644]
textures/moretrees_rubber_tree_wood.png [new file with mode: 0644]
textures/moretrees_sequoia.png [new file with mode: 0644]
textures/moretrees_sequoia_leaves.png [new file with mode: 0644]
textures/moretrees_sequoia_sapling.png [new file with mode: 0644]
textures/moretrees_sequoia_top.png [new file with mode: 0644]
textures/moretrees_sequoia_wood.png [new file with mode: 0644]
textures/moretrees_spruce.png [new file with mode: 0644]
textures/moretrees_spruce_cone.png [new file with mode: 0644]
textures/moretrees_spruce_leaves.png [new file with mode: 0644]
textures/moretrees_spruce_sapling.png [new file with mode: 0644]
textures/moretrees_spruce_top.png [new file with mode: 0644]
textures/moretrees_spruce_wood.png [new file with mode: 0644]
textures/moretrees_willow.png [new file with mode: 0644]
textures/moretrees_willow_leaves.png [new file with mode: 0644]
textures/moretrees_willow_sapling.png [new file with mode: 0644]
textures/moretrees_willow_top.png [new file with mode: 0644]
textures/moretrees_willow_wood.png [new file with mode: 0644]
tree_biomes.txt [new file with mode: 0644]
tree_models.lua [new file with mode: 0644]

index 62a24b2270c9fc991bcebc7f1de4f764f806edbe..f083bb620665b7a191756426fb2d4791301e5cff 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,16 +1,13 @@
 More trees!
 
-This mod adds more types of trees to the game
-at present, they consist of jungle trees and conifers
+This mod adds a whole bunch of new types of trees to the game
 
 Much of the code here came from cisoun's conifers mod and bas080's 
-jungle trees mod.
+jungle trees mod, and big contributions by RealBadAngel.
 
 Brought together into one mod and made L-systems compatible by Vanessa
 Ezekowitz.
 
-Jungle tree axioms/rules tweaked by RealBadAngel
-
 License:  WTFPL
 
 Dependencies:  plants_lib (or plantlife modpack), default
diff --git a/biome_defs.lua b/biome_defs.lua
new file mode 100644 (file)
index 0000000..c03f673
--- /dev/null
@@ -0,0 +1,148 @@
+--[[
+
+-- Example biome definition:
+
+mytree_biome = {
+       surface = "default:dirt_with_grass",    -- must grow on these nodes only
+       avoid_nodes = {"default:tree"},         -- avoid spawning near these
+       avoid_radius = 12,                      -- Keep this much room around the above avoid items
+       seed_diff = 12345,                      -- perlin seed-diff for "generally able to grow plants here" control
+       neighbors = "default:dirt_with_grass",  -- this node must be adjacent to the node being spawned on
+       ncount = 8,                             -- and there must be this many of them
+       depth = 1,                              -- spawning surface must be no deeper than this
+       min_elevation = -5,                     -- minimum elevation to spawn on
+       max_elevation = 10,                     -- maximum elevation
+       near_nodes = {"default:water_source"},  -- trees will only spawn near these nodes
+       near_nodes_size = 10,                   -- within this radius of at least one of them
+       near_nodes_count = 20,                  -- there must ne this many of those nodes in the area
+       temp_min = 0.5,                         -- minimum allowable temperature (highest temperature map perlin value)
+       temp_max = 0.1,                         -- maximum allowable temperature (lowest perlin value)
+}
+]]--
+
+moretrees.jungletree_biome = {
+       surface = "default:dirt_with_grass",
+       avoid_nodes = moretrees.avoidnodes,
+       avoid_radius = 12,
+       seed_diff = 329,
+       min_elevation = -5,
+       max_elevation = 10,
+       near_nodes = {"default:water_source"},
+       near_nodes_size = 15,
+       near_nodes_count = 10,
+--     temp_min = 0.05,
+}
+
+moretrees.conifer_biome = {
+       surface = "default:dirt_with_grass",
+       avoid_nodes = moretrees.avoidnodes,
+       avoid_radius = 10,
+       seed_diff = 359,
+       min_elevation = 25,
+       temp_min = 0.9,
+       temp_max = 0.3,
+}
+
+moretrees.palm_biome = {
+       surface = "default:sand",
+       avoid_nodes = moretrees.avoidnodes,
+       avoid_radius = 5,
+       seed_diff = 330,
+       min_elevation = -1,
+       max_elevation = 1,
+       near_nodes = {"default:water_source"},
+       near_nodes_size = 15,
+       near_nodes_count = 10,
+       temp_min = 0.15,
+       temp_max = -0.15,
+}
+
+moretrees.apple_biome = {
+       surface = "default:dirt_with_grass",
+       avoid_nodes = moretrees.avoidnodes,
+       avoid_radius = 15,
+       seed_diff = 331,
+       min_elevation = 1,
+       max_elevation = 10,
+       temp_min = 0.1,
+       temp_max = -0.15,
+}
+
+moretrees.oak_biome = {
+       surface = "default:dirt_with_grass",
+       avoid_nodes = moretrees.avoidnodes,
+       avoid_radius = 15,
+       seed_diff = 332,
+       min_elevation = 0,
+       max_elevation = 10,
+       temp_min = 0.4,
+       temp_max = 0.2,
+}
+
+moretrees.sequoia_biome = {
+       surface = "default:dirt_with_grass",
+       avoid_nodes = moretrees.avoidnodes,
+       avoid_radius = 10,
+       seed_diff = 333,
+       min_elevation = 0,
+       max_elevation = 10,
+       temp_min = 1,
+       temp_max = -0.4,
+}
+
+moretrees.birch_biome = {
+       surface = "default:dirt_with_grass",
+       avoid_nodes = moretrees.avoidnodes,
+       avoid_radius = 5,
+       seed_diff = 334,
+       min_elevation = 10,
+       max_elevation = 15,
+       temp_min = 0.9,
+       temp_max = 0.3,
+}
+
+moretrees.spruce_biome = {
+       surface = "default:dirt_with_grass",
+       avoid_nodes = moretrees.avoidnodes,
+       avoid_radius = 10,
+       seed_diff = 335,
+       min_elevation = 20,
+       temp_min = 0.9,
+       temp_max = 0.7,
+}
+
+moretrees.pine_biome = {
+       surface = "default:dirt_with_grass",
+       avoid_nodes = moretrees.avoidnodes,
+       avoid_radius = 10,
+       seed_diff = 336,
+       near_nodes = {"default:water_source"},
+       near_nodes_size = 15,
+       near_nodes_count = 5,
+}
+
+moretrees.willow_biome = {
+       surface = "default:dirt_with_grass",
+       avoid_nodes = moretrees.avoidnodes,
+       avoid_radius = 20,
+       seed_diff = 337,
+       min_elevation = -5,
+       max_elevation = 5,
+       near_nodes = {"default:water_source"},
+       near_nodes_size = 15,
+       near_nodes_count = 5,
+}
+
+moretrees.rubber_biome = {
+       surface = "default:dirt_with_grass",
+       avoid_nodes = moretrees.avoidnodes,
+       avoid_radius = 20,
+       seed_diff = 338,
+       min_elevation = -5,
+       max_elevation = 5,
+       near_nodes = {"default:water_source"},
+       near_nodes_size = 15,
+       near_nodes_count = 10,
+       temp_min = -0.15,
+}
+
index 9c346bddbe47c5c35fa605f7d01c08a2c9532062..ff0bcf4a63cd41ee25d28c84ae8190681593f377 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -1,15 +1,16 @@
 -- More trees!
 --
 -- This mod adds more types of trees to the game
--- at present, they consist of jungle trees and conifers
 --
--- Much of the node definitions here came from cisoun's conifers mod and
--- bas080's jungle trees mod.
+-- Some of the node definitions and textures came from cisoun's conifers mod 
+-- and bas080's jungle trees mod.
 --
 -- Brought together into one mod and made L-systems compatible by Vanessa
 -- Ezekowitz.  Thrown together on 2013-01-09 :-)
 --
--- Jungle tree axioms/rules tweaked by RealBadAngel
+-- Conifers and Jungle tree axioms/rules by Vanessa Ezekowitz, with the 
+-- latter having been tweaked by RealBadAngel, most others written by
+-- RealBadAngel.
 --
 -- License: WTFPL for all parts (code and textures)
 --
 --             in_biome = true
 --     end
 --     
--- We'll just save this for later use ;-)
+-- We'll just save this for possible later use ;-)
 --
-
 moretrees = {}
 
--- Jungletree init stuff:
-
-local JT_SPAWN_INTERVAL = 1000
-local JT_SPAWN_CHANCE = 100
-
-local JT_GROW_INTERVAL = 100
-local JT_GROW_CHANCE = 10
-
-local JT_RADIUS = 15
-local JT_WATER_RADIUS = 15
-local JT_WATER_COUNT = 10
-
-local jungletree_seed_diff = plantslib.plantlife_seed_diff
-
--- Conifers init stuff:
-
-local CONIFERS_SPAWN_SAPLING_INTERVAL = 1000
-local CONIFERS_SPAWN_SAPLING_CHANCE = 100
-
-local CONIFERS_GROW_SAPLING_INTERVAL = 100
-local CONIFERS_GROW_SAPLING_CHANCE = 10
-
-local CONIFERS_DISTANCE = 9 -- how far apart should conifer saplings spawn?
-local CONIFERS_ALTITUDE = 25
-
-local CONIFERS_REMOVE_TREES = false -- Remove trees above CONIFERS_ALTITUDE?
-local CONIFERS_RTREES_INTERVAL = 360
-local CONIFERS_RTREES_CHANCE = 10
-
-local conifers_seed_diff = plantslib.plantlife_seed_diff + 30
-
--- Spawning functions
-
-jungletrees_biome = {
-       surface = "default:dirt_with_grass",    -- must grow on grass only
-       avoid = {"jungletree:sapling","default:jungletree"}, -- avoid spawning near these
-       radius = JT_RADIUS,                     -- Keep this much room around the above avoid items
-       seed_diff = jungletree_seed_diff,       -- duh? :-)
-       neighbors = nil,                        -- we don't care about neighbors
-       ncount = nil,                           -- or the count thereof
-       depth = nil,                            -- or depth of the spawn surface
-       min_elevation = -5,                     -- must be 5m below sea level or higher
-       max_elevation = 10,                     -- but no higher than 10m
-       near_nodes = {"default:water_source"},  -- Jungle trees must be near water
-       near_nodes_size = JT_WATER_RADIUS,      -- within this radius of it (default 25)
-       near_nodes_count = JT_WATER_COUNT,      -- with this many water nodes in the area
-       temp_min = nil,                         -- don't care about temperature
-       temp_max = nil,                         -- at either end of the scale
-       exec_funct = "moretrees:grow_jungletree" -- name of the function to execute to grow a tree
-}
-
-conifers_biome = {
-       surface = "default:dirt_with_grass",
-       avoid = {"conifers:sapling", "conifers:trunk"},
-       radius = CONIFERS_DISTANCE,
-       seed_diff = conifers_seed_diff,                                                                                                         
-       neighbors = nil,
-       ncount = nil,
-       depth = nil,
-       min_elevation = CONIFERS_ALTITUDE,
-       max_elevation = nil,
-       near_nodes = nil,
-       near_nodes_size = nil,
-       near_nodes_count = nil,
-       temp_min = nil,
-       temp_max = nil,
-       exec_funct = "moretrees:grow_conifer"
-}
-
-plantslib:register_generate_plant(jungletrees_biome)
-plantslib:register_generate_plant(conifers_biome)
-
--- growing functions
-
-plantslib:grow_plants(
-       JT_GROW_INTERVAL,
-       JT_GROW_CHANCE,
-       "jungletree:sapling",
-       nil,
-       nil,
-       nil,
-       nil,
-       nil,
-       nil,
-       nil,
-       nil,
-       "moretrees:grow_jungletree",
-       jungletree_seed_diff
-)
-
-plantslib:grow_plants(
-       CONIFERS_GROW_SAPLING_INTERVAL,
-       CONIFERS_GROW_SAPLING_CHANCE,
-       "conifers:sapling",
-       nil,
-       nil,
-       nil,
-       nil,
-       nil,
-       nil,
-       nil,
-       nil,
-       "moretrees:grow_conifer",
-       conifers_seed_diff
-)
+dofile(minetest.get_modpath("moretrees").."/crafts.lua")
+dofile(minetest.get_modpath("moretrees").."/node_defs.lua")
+dofile(minetest.get_modpath("moretrees").."/tree_models.lua")
+dofile(minetest.get_modpath("moretrees").."/biome_defs.lua")
 
--- L-System Tree definitions
+plantslib:register_generate_plant(moretrees.jungletree_biome, "moretrees:grow_jungletree")
+plantslib:register_generate_plant(moretrees.conifer_biome, "moretrees:grow_conifer")
 
-local jungle_tree={
-       axiom=nil,
-       rules_a=nil,
-       rules_b=nil,
-       trunk="default:jungletree",
-       leaves="jungletree:leaves_green",
-       leaves2=nil,
-       leaves2_chance=nil,
-       angle=45,
-       iterations=nil,
-       random_level=2,
-       trunk_type=nil,
-       thin_branches=true;
-       fruit_chance=15,
-       fruit="vines:vine"
-}
+--plantslib:register_generate_plant(moretrees.palm_biome, moretrees.palm_model)
 
-local jt_axiom1 = "FFFA"
-local jt_rules_a1 = "FFF[&&-FBf[&&&Ff]^^^Ff][&&+FBFf[&&&FFf]^^^Ff][&&---FBFf[&&&Ff]^^^Ff][&&+++FBFf[&&&Ff]^^^Ff]F/A"
-local jt_rules_b1 = "[-Ff&f][+Ff&f]B"
+--------------------------
+-- Other stuff
+--
+-- for backward compatibility with previous mods/code, jungle trees and
+-- firs ("conifers") L-Systems definitions are established separately.
+--
+--------------------------
 
-local jt_axiom2 = "FFFFFA"
-local jt_rules_a2 = "FFFFF[&&-FFFBF[&&&FFff]^^^FFf][&&+FFFBFF[&&&FFff]^^^FFf][&&---FFFBFF[&&&FFff]^^^FFf][&&+++FFFBFF[&&&FFff]^^^FFf]FF/A"
-local jt_rules_b2 = "[-FFf&ff][+FFf&ff]B"
+-- Code that spawns jungle trees and firs ("conifers")
 
-local conifer_tree={
-       axiom="FFFAF[&&-F][&&+F][&&---F][&&+++F]Fff",
-       rules_a=nil,
-       rules_b=nil,
-       trunk="conifers:trunk",
-       leaves=nil,
-       angle=45,
-       iterations=7,
-       random_level=5,
-       thin_trunks=true
-}
+moretrees.jt_axiom1 = "FFFA"
+moretrees.jt_rules_a1 = "FFF[&&-FBf[&&&Ff]^^^Ff][&&+FBFf[&&&FFf]^^^Ff][&&---FBFf[&&&Ff]^^^Ff][&&+++FBFf[&&&Ff]^^^Ff]F/A"
+moretrees.jt_rules_b1 = "[-Ff&f][+Ff&f]B"
 
-local ct_rules_a1 = "FF[FF][&&-FBF][&&+FBF][&&---FBF][&&+++FBF]F/A"
-local ct_rules_b1 = "[-FBf][+FBf]"
+moretrees.jt_axiom2 = "FFFFFA"
+moretrees.jt_rules_a2 = "FFFFF[&&-FFFBF[&&&FFff]^^^FFf][&&+FFFBFF[&&&FFff]^^^FFf][&&---FFFBFF[&&&FFff]^^^FFf][&&+++FFFBFF[&&&FFff]^^^FFf]FF/A"
+moretrees.jt_rules_b2 = "[-FFf&ff][+FFf&ff]B"
 
-local ct_rules_a2 = "FF[FF][&&-FBF][&&+FBF][&&---FBF][&&+++FBF]F/A"
-local ct_rules_b2 = "[-fB][+fB]"
+moretrees.ct_rules_a1 = "FF[FF][&&-FBF][&&+FBF][&&---FBF][&&+++FBF]F/A"
+moretrees.ct_rules_b1 = "[-FBf][+FBf]"
 
--- Code that actually spawns the trees!
+moretrees.ct_rules_a2 = "FF[FF][&&-FBF][&&+FBF][&&---FBF][&&+++FBF]F/A"
+moretrees.ct_rules_b2 = "[-fB][+fB]"
 
 function moretrees:grow_jungletree(pos)
        local r1 = math.random(2)
        local r2 = math.random(3)
        if r1 == 1 then
-               jungle_tree["leaves2"] = "jungletree:leaves_red"
+               moretrees.jungletree_model.leaves2 = "jungletree:leaves_red"
        else 
-               jungle_tree["leaves2"] = "jungletree:leaves_yellow"
+               moretrees.jungletree_model.leaves2 = "jungletree:leaves_yellow"
        end
-       jungle_tree["leaves2_chance"] = math.random(25, 75)
+       moretrees.jungletree_model.leaves2_chance = math.random(25, 75)
 
        if r2 == 1 then
-               jungle_tree["trunk_type"] = "single"
-               jungle_tree["iterations"] = 2
-               jungle_tree["axiom"] = jt_axiom1
-               jungle_tree["rules_a"] = jt_rules_a1
-               jungle_tree["rules_b"] = jt_rules_b1
+               moretrees.jungletree_model.trunk_type = "single"
+               moretrees.jungletree_model.iterations = 2
+               moretrees.jungletree_model.axiom = moretrees.jt_axiom1
+               moretrees.jungletree_model.rules_a = moretrees.jt_rules_a1
+               moretrees.jungletree_model.rules_b = moretrees.jt_rules_b1
        elseif r2 == 2 then
-               jungle_tree["trunk_type"] = "double"
-               jungle_tree["iterations"] = 4
-               jungle_tree["axiom"] = jt_axiom2
-               jungle_tree["rules_a"] = jt_rules_a2
-               jungle_tree["rules_b"] = jt_rules_b2
+               moretrees.jungletree_model.trunk_type = "double"
+               moretrees.jungletree_model.iterations = 4
+               moretrees.jungletree_model.axiom = moretrees.jt_axiom2
+               moretrees.jungletree_model.rules_a = moretrees.jt_rules_a2
+               moretrees.jungletree_model.rules_b = moretrees.jt_rules_b2
        elseif r2 == 3 then
-               jungle_tree["trunk_type"] = "crossed"
-               jungle_tree["iterations"] = 4
-               jungle_tree["axiom"] = jt_axiom2
-               jungle_tree["rules_a"] = jt_rules_a2
-               jungle_tree["rules_b"] = jt_rules_b2
+               moretrees.jungletree_model.trunk_type = "crossed"
+               moretrees.jungletree_model.iterations = 4
+               moretrees.jungletree_model.axiom = moretrees.jt_axiom2
+               moretrees.jungletree_model.rules_a = moretrees.jt_rules_a2
+               moretrees.jungletree_model.rules_b = moretrees.jt_rules_b2
        end
 
        minetest.env:remove_node(pos)
@@ -217,21 +98,21 @@ function moretrees:grow_jungletree(pos)
        for leaf in ipairs(leaves) do
                        minetest.env:remove_node(leaves[leaf])
        end
-       minetest.env:spawn_tree(pos,jungle_tree)
+       minetest.env:spawn_tree(pos, moretrees.jungletree_model)
 end
 
 function moretrees:grow_conifer(pos)
        if math.random(2) == 1 then
-               conifer_tree["leaves"]="conifers:leaves"
+               moretrees.conifer_model.leaves="conifers:leaves"
        else
-               conifer_tree["leaves"]="conifers:leaves_special"
+               moretrees.conifer_model.leaves="conifers:leaves_special"
        end
        if math.random(2) == 1 then
-               conifer_tree["rules_a"] = ct_rules_a1
-               conifer_tree["rules_b"] = ct_rules_b1
+               moretrees.conifer_model.rules_a = moretrees.ct_rules_a1
+               moretrees.conifer_model.rules_b = moretrees.ct_rules_b1
        else
-               conifer_tree["rules_a"] = ct_rules_a2
-               conifer_tree["rules_b"] = ct_rules_b2
+               moretrees.conifer_model.rules_a = moretrees.ct_rules_a2
+               moretrees.conifer_model.rules_b = moretrees.ct_rules_b2
        end
 
        minetest.env:remove_node(pos)
@@ -239,12 +120,13 @@ function moretrees:grow_conifer(pos)
        for leaf in ipairs(leaves) do
                        minetest.env:remove_node(leaves[leaf])
        end
-       minetest.env:spawn_tree(pos,conifer_tree)
+       minetest.env:spawn_tree(pos,moretrees.conifer_model)
 end
 
--- Other stuff
+
 
 -- Should we remove all the trees above the conifers altitude?
+
 if CONIFERS_REMOVE_TREES == true then
        minetest.register_abm({
                nodenames = {
@@ -264,176 +146,4 @@ if CONIFERS_REMOVE_TREES == true then
        })
 end
 
--- Nodes for jungle trees
-
-minetest.register_node(":jungletree:sapling", {
-       description = "Jungle Tree Sapling",    
-       drawtype = "plantlike", 
-       visual_scale = 1.0,     
-       tiles = {"jungletree_sapling.png"},     
-       inventory_image = "jungletree_sapling.png",     
-       wield_image = "default_sapling.png",    
-       paramtype = "light",    
-       walkable = false,       
-       groups = {snappy=2,dig_immediate=3,flammable=2},
-})
-
-local leaves = {"green","yellow","red"}
-for color = 1, 3 do
-       local leave_name = ":jungletree:leaves_"..leaves[color]
-       minetest.register_node(leave_name, {
-               description = "Jungle Tree Leaves",
-               drawtype = "allfaces_optional",
-               tiles = {"jungletree_leaves_"..leaves[color]..".png"},
-               paramtype = "light",
-               groups = {snappy=3, leafdecay=3, flammable=2},
-               drop = {
-                       max_items = 1,
-                       items = {
-                               {
-                                       -- player will get sapling with 1/20 chance
-                                       items = {'jungletree:sapling'},
-                                       rarity = 20,
-                               },
-                               {
-                                       -- player will get leaves only if he get no saplings,
-                                       -- this is because max_items is 1
-                                       items = {"jungletree:leaves_"..leaves[color]},
-                               }
-                       }
-               },
-               sounds = default.node_sound_leaves_defaults(),
-       })
-end
-
--- Nodes for conifers
-
-minetest.register_node(":conifers:trunk", {
-       description = "Conifer trunk",
-       tile_images = { 
-               "conifers_trunktop.png", 
-               "conifers_trunktop.png", 
-               "conifers_trunk.png", 
-               "conifers_trunk.png", 
-               "conifers_trunk.png", 
-               "conifers_trunk.png" 
-       },
-       paramtype = "facedir_simple",
-       is_ground_content = true,
-       groups = {
-               tree = 1,
-               snappy = 2,
-               choppy = 2,
-               oddly_breakable_by_hand = 1,
-               flammable = 2
-       },
-       sounds = default.node_sound_wood_defaults()
-})
-
-minetest.register_node(":conifers:trunk_reversed", {
-       description = "Conifer reversed trunk",
-       tile_images = { 
-               "conifers_trunk_reversed.png", 
-               "conifers_trunk_reversed.png",
-               "conifers_trunktop.png", 
-               "conifers_trunktop.png", 
-               "conifers_trunk_reversed.png", 
-               "conifers_trunk_reversed.png" 
-       },
-       --inventory_image = minetest.inventorycube(
-               --"conifers_trunk.png",
-               --"conifers_trunktop.png",
-               --"conifers_trunk.png"
-       --),
-       paramtype = "facedir_simple",
-       material = minetest.digprop_woodlike(1.0),
-       legacy_facedir_simple = true,
-       is_ground_content = true,
-       groups = {
-               tree = 1,
-               snappy = 2,
-               choppy = 2,
-               oddly_breakable_by_hand = 1,
-               flammable = 2
-       },
-       sounds = default.node_sound_wood_defaults()
-})
-
-minetest.register_node(":conifers:leaves", {
-       description = "Conifer leaves",
-       drawtype = "allfaces_optional",
-       visual_scale = 1.3,
-       tile_images = { "conifers_leaves.png" },
-       paramtype = "light",
-       groups = {
-               snappy = 3,
-               leafdecay = 3,
-               flammable = 2
-       },
-       drop = {
-               max_items = 1,
-               items = {
-                       {
-                               -- player will get sapling with 1/20 chance
-                               items = {'conifers:sapling'},
-                               rarity = 20,
-                       },
-                       {
-                               -- player will get leaves only if he get no saplings,
-                               -- this is because max_items is 1
-                               items = {'conifers:leaves'},
-                       }
-               }
-       },
-       sounds = default.node_sound_leaves_defaults()
-})
-
-minetest.register_node(":conifers:leaves_special", {
-       description = "Bright conifer leaves",
-       drawtype = "allfaces_optional",
-       visual_scale = 1.3,
-       tile_images = { "conifers_leaves_special.png" },
-       paramtype = "light",
-       groups = {
-               snappy = 3,
-               leafdecay = 3,
-               flammable = 2
-       },
-       drop = {
-               max_items = 1,
-               items = {
-                       {
-                               -- player will get sapling with 1/20 chance
-                               items = {'conifers:sapling'},
-                               rarity = 20,
-                       },
-                       {
-                               -- player will get leaves only if he get no saplings,
-                               -- this is because max_items is 1
-                               items = {'conifers:leaves'},
-                       }
-               }
-       },
-       sounds = default.node_sound_leaves_defaults()
-})
-
-minetest.register_node(":conifers:sapling", {
-       description = "Conifer sapling",
-       drawtype = "plantlike",
-       visual_scale = 1.0,
-       tile_images = {"conifers_sapling.png"},
-       inventory_image = "conifers_sapling.png",
-       wield_image = "conifers_sapling.png",
-       paramtype = "light",
-       walkable = false,
-       groups = {
-               snappy = 2,
-               dig_immediate = 3,
-               flammable = 2
-       },
-       sounds = default.node_sound_defaults(),
-})
-
-dofile(minetest.get_modpath("moretrees").."/crafts.lua")
-
 print("[Moretrees] Loaded (2013-01-18)")
diff --git a/node_defs.lua b/node_defs.lua
new file mode 100644 (file)
index 0000000..0ba7ae7
--- /dev/null
@@ -0,0 +1,287 @@
+leaves = {
+       {"beech",               "Beech Leaves"},
+       {"apple_tree",          "Apple Tree Leaves"},
+       {"oak",                 "Oak Leaves"},
+       {"sequoia",             "Sequoia Needles"},
+       {"birch",               "Birch Leaves"},
+       {"palm",                "Palm Leaves"},
+       {"spruce",              "Spruce Needles"},
+       {"pine",                "Pine Needles"},
+       {"willow",              "Willow Leaves"},
+       {"rubber_tree",         "Rubber Tree Leaves"},
+}
+
+for i in ipairs(leaves) do
+       local name = leaves[i]
+       minetest.register_node("moretrees:"..leaves[i][1].."_leaves", {
+               description = leaves[i][2],
+               drawtype = "allfaces_optional",
+               visual_scale = 1.3,
+               tiles = { "moretrees_"..leaves[i][1].."_leaves.png" },
+               paramtype = "light",
+               groups = {tree=1, snappy=3, flammable=2},
+               sounds = default.node_sound_leaves_defaults(),
+       })
+       end
+       
+trees = {
+       {"beech",       "Beech",        nil,            nil,            nil                             },
+       {"apple_tree",  "Apple Tree",   nil,            nil,            nil                             },
+       {"oak",         "Oak",          "acorn",        "Acorn",        {-0.2, -0.5, -0.2, 0.2, 0, 0.2} },
+       {"sequoia",     "Sequoia",      nil,            nil,            nil                             },
+       {"birch",       "Birch",        nil,            nil,            nil                             },
+       {"palm",        "Palm",         "coconut",      "Coconut",      {-0.2, -0.5, -0.2, 0.2, 0, 0.2} },
+       {"spruce",      "Spruce",       "spruce_cone",  "Spruce Cone",  {-0.2, -0.5, -0.2, 0.2, 0, 0.2} },
+       {"pine",        "Pine",         "pine_cone",    "Pine Cone",    {-0.2, -0.5, -0.2, 0.2, 0, 0.2} },
+       {"willow",      "Willow",       nil,            nil,            nil                             },
+       {"rubber_tree", "Rubber Tree",  nil,            nil,            nil                             },
+}
+
+moretrees.avoidnodes = {}
+
+table.insert(moretrees.avoidnodes, "default:jungletree")
+table.insert(moretrees.avoidnodes, "jungletree:sapling")
+table.insert(moretrees.avoidnodes, "conifers:trunk")
+table.insert(moretrees.avoidnodes, "conifers:sapling")
+
+for i in ipairs(trees) do
+       local treename = trees[i][1]
+       local treedesc = trees[i][2]
+       local fruit = trees[i][3]
+       local fruitdesc = trees[i][4]
+       local selbox = trees[i][5]
+
+       table.insert(moretrees.avoidnodes, "moretrees:"..treename.."_trunk")
+       table.insert(moretrees.avoidnodes, "moretrees:"..treename.."_sapling")
+
+       minetest.register_node("moretrees:"..treename.."_trunk", {
+               description = treedesc.." Trunk",
+               tiles = {
+                       "moretrees_"..treename.."_top.png",
+                       "moretrees_"..treename.."_top.png",
+                       "moretrees_"..treename..".png"
+               },
+               is_ground_content = true,
+               groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
+               sounds = default.node_sound_wood_defaults(),
+       })
+
+       minetest.register_node("moretrees:"..treename.."_planks", {
+               description = treedesc.." Planks",
+               tiles = {"moretrees_"..treename.."_wood.png"},
+               is_ground_content = true,
+               groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
+               sounds = default.node_sound_wood_defaults(),
+       })
+
+       minetest.register_node("moretrees:"..treename.."_sapling", {
+       description = treedesc.." Sapling",
+       drawtype = "plantlike",
+       visual_scale = 1.0,
+       tiles = {"moretrees_"..treename.."_sapling.png"},
+       inventory_image = "moretrees_"..treename.."_sapling.png",
+       wield_image = "moretrees_"..treename.."_sapling.png",
+       paramtype = "light",
+       walkable = false,
+       selection_box = {
+               type = "fixed",
+               fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
+       },
+       groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1},
+       sounds = default.node_sound_defaults(),
+       })
+       
+       if (fruit ~= nil) then
+               minetest.register_node("moretrees:"..fruit, {
+                       description = fruitdesc,
+                       drawtype = "plantlike",
+                       visual_scale = 0.8,
+                       tiles = { "moretrees_"..fruit..".png" },
+                       inventory_image = "moretrees_"..fruit..".png",
+                       paramtype = "light",
+                       sunlight_propagates = true,
+                       walkable = false,
+                       selection_box = {
+                               type = "fixed",
+                                       fixed = selbox
+                               },
+                       groups = {fleshy=3,dig_immediate=3,flammable=2},
+                       sounds = default.node_sound_defaults(),
+               })
+       end
+
+end
+
+--- For backward compatibility, jungle trees and firs ("conifers") are defined
+--- separately.
+
+-- Nodes for jungle trees
+
+minetest.register_node(":jungletree:sapling", {
+       description = "Jungle Tree Sapling",    
+       drawtype = "plantlike", 
+       visual_scale = 1.0,     
+       tiles = {"jungletree_sapling.png"},     
+       inventory_image = "jungletree_sapling.png",     
+       wield_image = "default_sapling.png",    
+       paramtype = "light",    
+       walkable = false,       
+       groups = {snappy=2,dig_immediate=3,flammable=2},
+})
+
+local leaves = {"green","yellow","red"}
+for color = 1, 3 do
+       local leave_name = ":jungletree:leaves_"..leaves[color]
+       minetest.register_node(leave_name, {
+               description = "Jungle Tree Leaves",
+               drawtype = "allfaces_optional",
+               tiles = {"jungletree_leaves_"..leaves[color]..".png"},
+               paramtype = "light",
+               groups = {snappy=3, leafdecay=3, flammable=2},
+               drop = {
+                       max_items = 1,
+                       items = {
+                               {
+                                       -- player will get sapling with 1/20 chance
+                                       items = {'jungletree:sapling'},
+                                       rarity = 20,
+                               },
+                               {
+                                       -- player will get leaves only if he get no saplings,
+                                       -- this is because max_items is 1
+                                       items = {"jungletree:leaves_"..leaves[color]},
+                               }
+                       }
+               },
+               sounds = default.node_sound_leaves_defaults(),
+       })
+end
+
+-- Nodes for conifers
+
+minetest.register_node(":conifers:trunk", {
+       description = "Conifer trunk",
+       tile_images = { 
+               "conifers_trunktop.png", 
+               "conifers_trunktop.png", 
+               "conifers_trunk.png", 
+               "conifers_trunk.png", 
+               "conifers_trunk.png", 
+               "conifers_trunk.png" 
+       },
+       paramtype = "facedir_simple",
+       is_ground_content = true,
+       groups = {
+               tree = 1,
+               snappy = 2,
+               choppy = 2,
+               oddly_breakable_by_hand = 1,
+               flammable = 2
+       },
+       sounds = default.node_sound_wood_defaults()
+})
+
+minetest.register_node(":conifers:trunk_reversed", {
+       description = "Conifer reversed trunk",
+       tile_images = { 
+               "conifers_trunk_reversed.png", 
+               "conifers_trunk_reversed.png",
+               "conifers_trunktop.png", 
+               "conifers_trunktop.png", 
+               "conifers_trunk_reversed.png", 
+               "conifers_trunk_reversed.png" 
+       },
+       --inventory_image = minetest.inventorycube(
+               --"conifers_trunk.png",
+               --"conifers_trunktop.png",
+               --"conifers_trunk.png"
+       --),
+       paramtype = "facedir_simple",
+       material = minetest.digprop_woodlike(1.0),
+       legacy_facedir_simple = true,
+       is_ground_content = true,
+       groups = {
+               tree = 1,
+               snappy = 2,
+               choppy = 2,
+               oddly_breakable_by_hand = 1,
+               flammable = 2
+       },
+       sounds = default.node_sound_wood_defaults()
+})
+
+minetest.register_node(":conifers:leaves", {
+       description = "Conifer leaves",
+       drawtype = "allfaces_optional",
+       visual_scale = 1.3,
+       tile_images = { "conifers_leaves.png" },
+       paramtype = "light",
+       groups = {
+               snappy = 3,
+               leafdecay = 3,
+               flammable = 2
+       },
+       drop = {
+               max_items = 1,
+               items = {
+                       {
+                               -- player will get sapling with 1/20 chance
+                               items = {'conifers:sapling'},
+                               rarity = 20,
+                       },
+                       {
+                               -- player will get leaves only if he get no saplings,
+                               -- this is because max_items is 1
+                               items = {'conifers:leaves'},
+                       }
+               }
+       },
+       sounds = default.node_sound_leaves_defaults()
+})
+
+minetest.register_node(":conifers:leaves_special", {
+       description = "Bright conifer leaves",
+       drawtype = "allfaces_optional",
+       visual_scale = 1.3,
+       tile_images = { "conifers_leaves_special.png" },
+       paramtype = "light",
+       groups = {
+               snappy = 3,
+               leafdecay = 3,
+               flammable = 2
+       },
+       drop = {
+               max_items = 1,
+               items = {
+                       {
+                               -- player will get sapling with 1/20 chance
+                               items = {'conifers:sapling'},
+                               rarity = 20,
+                       },
+                       {
+                               -- player will get leaves only if he get no saplings,
+                               -- this is because max_items is 1
+                               items = {'conifers:leaves'},
+                       }
+               }
+       },
+       sounds = default.node_sound_leaves_defaults()
+})
+
+minetest.register_node(":conifers:sapling", {
+       description = "Conifer sapling",
+       drawtype = "plantlike",
+       visual_scale = 1.0,
+       tile_images = {"conifers_sapling.png"},
+       inventory_image = "conifers_sapling.png",
+       wield_image = "conifers_sapling.png",
+       paramtype = "light",
+       walkable = false,
+       groups = {
+               snappy = 2,
+               dig_immediate = 3,
+               flammable = 2
+       },
+       sounds = default.node_sound_defaults(),
+})
+
diff --git a/textures/moretrees_acorn.png b/textures/moretrees_acorn.png
new file mode 100644 (file)
index 0000000..67b4d92
Binary files /dev/null and b/textures/moretrees_acorn.png differ
diff --git a/textures/moretrees_apple_tree.png b/textures/moretrees_apple_tree.png
new file mode 100644 (file)
index 0000000..7f2041d
Binary files /dev/null and b/textures/moretrees_apple_tree.png differ
diff --git a/textures/moretrees_apple_tree_leaves.png b/textures/moretrees_apple_tree_leaves.png
new file mode 100644 (file)
index 0000000..d410a83
Binary files /dev/null and b/textures/moretrees_apple_tree_leaves.png differ
diff --git a/textures/moretrees_apple_tree_sapling.png b/textures/moretrees_apple_tree_sapling.png
new file mode 100644 (file)
index 0000000..da12c56
Binary files /dev/null and b/textures/moretrees_apple_tree_sapling.png differ
diff --git a/textures/moretrees_apple_tree_top.png b/textures/moretrees_apple_tree_top.png
new file mode 100644 (file)
index 0000000..2aa3cd2
Binary files /dev/null and b/textures/moretrees_apple_tree_top.png differ
diff --git a/textures/moretrees_apple_tree_wood.png b/textures/moretrees_apple_tree_wood.png
new file mode 100644 (file)
index 0000000..dde0489
Binary files /dev/null and b/textures/moretrees_apple_tree_wood.png differ
diff --git a/textures/moretrees_beech.png b/textures/moretrees_beech.png
new file mode 100755 (executable)
index 0000000..ab12501
Binary files /dev/null and b/textures/moretrees_beech.png differ
diff --git a/textures/moretrees_beech_leaves.png b/textures/moretrees_beech_leaves.png
new file mode 100755 (executable)
index 0000000..d0258ed
Binary files /dev/null and b/textures/moretrees_beech_leaves.png differ
diff --git a/textures/moretrees_beech_sapling.png b/textures/moretrees_beech_sapling.png
new file mode 100644 (file)
index 0000000..d03c3e4
Binary files /dev/null and b/textures/moretrees_beech_sapling.png differ
diff --git a/textures/moretrees_beech_top.png b/textures/moretrees_beech_top.png
new file mode 100755 (executable)
index 0000000..6d62006
Binary files /dev/null and b/textures/moretrees_beech_top.png differ
diff --git a/textures/moretrees_beech_wood.png b/textures/moretrees_beech_wood.png
new file mode 100644 (file)
index 0000000..66f2b72
Binary files /dev/null and b/textures/moretrees_beech_wood.png differ
diff --git a/textures/moretrees_birch.png b/textures/moretrees_birch.png
new file mode 100644 (file)
index 0000000..3da8013
Binary files /dev/null and b/textures/moretrees_birch.png differ
diff --git a/textures/moretrees_birch_leaves.png b/textures/moretrees_birch_leaves.png
new file mode 100644 (file)
index 0000000..d5d2bb8
Binary files /dev/null and b/textures/moretrees_birch_leaves.png differ
diff --git a/textures/moretrees_birch_sapling.png b/textures/moretrees_birch_sapling.png
new file mode 100644 (file)
index 0000000..4f0c198
Binary files /dev/null and b/textures/moretrees_birch_sapling.png differ
diff --git a/textures/moretrees_birch_top.png b/textures/moretrees_birch_top.png
new file mode 100644 (file)
index 0000000..7ca4aa2
Binary files /dev/null and b/textures/moretrees_birch_top.png differ
diff --git a/textures/moretrees_birch_wood.png b/textures/moretrees_birch_wood.png
new file mode 100644 (file)
index 0000000..1bd7f6b
Binary files /dev/null and b/textures/moretrees_birch_wood.png differ
diff --git a/textures/moretrees_coconut.png b/textures/moretrees_coconut.png
new file mode 100644 (file)
index 0000000..3c1321f
Binary files /dev/null and b/textures/moretrees_coconut.png differ
diff --git a/textures/moretrees_oak.png b/textures/moretrees_oak.png
new file mode 100644 (file)
index 0000000..431695e
Binary files /dev/null and b/textures/moretrees_oak.png differ
diff --git a/textures/moretrees_oak_leaves.png b/textures/moretrees_oak_leaves.png
new file mode 100644 (file)
index 0000000..4732751
Binary files /dev/null and b/textures/moretrees_oak_leaves.png differ
diff --git a/textures/moretrees_oak_sapling.png b/textures/moretrees_oak_sapling.png
new file mode 100644 (file)
index 0000000..953f071
Binary files /dev/null and b/textures/moretrees_oak_sapling.png differ
diff --git a/textures/moretrees_oak_top.png b/textures/moretrees_oak_top.png
new file mode 100644 (file)
index 0000000..daeb336
Binary files /dev/null and b/textures/moretrees_oak_top.png differ
diff --git a/textures/moretrees_oak_wood.png b/textures/moretrees_oak_wood.png
new file mode 100644 (file)
index 0000000..67eb9d7
Binary files /dev/null and b/textures/moretrees_oak_wood.png differ
diff --git a/textures/moretrees_palm.png b/textures/moretrees_palm.png
new file mode 100644 (file)
index 0000000..c618419
Binary files /dev/null and b/textures/moretrees_palm.png differ
diff --git a/textures/moretrees_palm_leaves.png b/textures/moretrees_palm_leaves.png
new file mode 100644 (file)
index 0000000..77db491
Binary files /dev/null and b/textures/moretrees_palm_leaves.png differ
diff --git a/textures/moretrees_palm_sapling.png b/textures/moretrees_palm_sapling.png
new file mode 100644 (file)
index 0000000..2d93a80
Binary files /dev/null and b/textures/moretrees_palm_sapling.png differ
diff --git a/textures/moretrees_palm_top.png b/textures/moretrees_palm_top.png
new file mode 100644 (file)
index 0000000..a2ec676
Binary files /dev/null and b/textures/moretrees_palm_top.png differ
diff --git a/textures/moretrees_palm_wood.png b/textures/moretrees_palm_wood.png
new file mode 100644 (file)
index 0000000..ddbe9a9
Binary files /dev/null and b/textures/moretrees_palm_wood.png differ
diff --git a/textures/moretrees_pine.png b/textures/moretrees_pine.png
new file mode 100644 (file)
index 0000000..0aa9bfd
Binary files /dev/null and b/textures/moretrees_pine.png differ
diff --git a/textures/moretrees_pine_cone.png b/textures/moretrees_pine_cone.png
new file mode 100644 (file)
index 0000000..6d450c8
Binary files /dev/null and b/textures/moretrees_pine_cone.png differ
diff --git a/textures/moretrees_pine_leaves.png b/textures/moretrees_pine_leaves.png
new file mode 100644 (file)
index 0000000..5aaf2a2
Binary files /dev/null and b/textures/moretrees_pine_leaves.png differ
diff --git a/textures/moretrees_pine_sapling.png b/textures/moretrees_pine_sapling.png
new file mode 100644 (file)
index 0000000..0d1963a
Binary files /dev/null and b/textures/moretrees_pine_sapling.png differ
diff --git a/textures/moretrees_pine_top.png b/textures/moretrees_pine_top.png
new file mode 100644 (file)
index 0000000..1584caf
Binary files /dev/null and b/textures/moretrees_pine_top.png differ
diff --git a/textures/moretrees_pine_wood.png b/textures/moretrees_pine_wood.png
new file mode 100644 (file)
index 0000000..a4942b2
Binary files /dev/null and b/textures/moretrees_pine_wood.png differ
diff --git a/textures/moretrees_rubber_tree.png b/textures/moretrees_rubber_tree.png
new file mode 100644 (file)
index 0000000..08067ef
Binary files /dev/null and b/textures/moretrees_rubber_tree.png differ
diff --git a/textures/moretrees_rubber_tree_leaves.png b/textures/moretrees_rubber_tree_leaves.png
new file mode 100644 (file)
index 0000000..ae013e0
Binary files /dev/null and b/textures/moretrees_rubber_tree_leaves.png differ
diff --git a/textures/moretrees_rubber_tree_sapling.png b/textures/moretrees_rubber_tree_sapling.png
new file mode 100644 (file)
index 0000000..e5c9f5d
Binary files /dev/null and b/textures/moretrees_rubber_tree_sapling.png differ
diff --git a/textures/moretrees_rubber_tree_top.png b/textures/moretrees_rubber_tree_top.png
new file mode 100644 (file)
index 0000000..dc26a7a
Binary files /dev/null and b/textures/moretrees_rubber_tree_top.png differ
diff --git a/textures/moretrees_rubber_tree_wood.png b/textures/moretrees_rubber_tree_wood.png
new file mode 100644 (file)
index 0000000..caf6674
Binary files /dev/null and b/textures/moretrees_rubber_tree_wood.png differ
diff --git a/textures/moretrees_sequoia.png b/textures/moretrees_sequoia.png
new file mode 100644 (file)
index 0000000..b0e5536
Binary files /dev/null and b/textures/moretrees_sequoia.png differ
diff --git a/textures/moretrees_sequoia_leaves.png b/textures/moretrees_sequoia_leaves.png
new file mode 100644 (file)
index 0000000..395ad6e
Binary files /dev/null and b/textures/moretrees_sequoia_leaves.png differ
diff --git a/textures/moretrees_sequoia_sapling.png b/textures/moretrees_sequoia_sapling.png
new file mode 100644 (file)
index 0000000..f517604
Binary files /dev/null and b/textures/moretrees_sequoia_sapling.png differ
diff --git a/textures/moretrees_sequoia_top.png b/textures/moretrees_sequoia_top.png
new file mode 100644 (file)
index 0000000..481bbdf
Binary files /dev/null and b/textures/moretrees_sequoia_top.png differ
diff --git a/textures/moretrees_sequoia_wood.png b/textures/moretrees_sequoia_wood.png
new file mode 100644 (file)
index 0000000..bc41cfb
Binary files /dev/null and b/textures/moretrees_sequoia_wood.png differ
diff --git a/textures/moretrees_spruce.png b/textures/moretrees_spruce.png
new file mode 100644 (file)
index 0000000..6e4e67a
Binary files /dev/null and b/textures/moretrees_spruce.png differ
diff --git a/textures/moretrees_spruce_cone.png b/textures/moretrees_spruce_cone.png
new file mode 100644 (file)
index 0000000..5144b71
Binary files /dev/null and b/textures/moretrees_spruce_cone.png differ
diff --git a/textures/moretrees_spruce_leaves.png b/textures/moretrees_spruce_leaves.png
new file mode 100644 (file)
index 0000000..cfaaa1c
Binary files /dev/null and b/textures/moretrees_spruce_leaves.png differ
diff --git a/textures/moretrees_spruce_sapling.png b/textures/moretrees_spruce_sapling.png
new file mode 100644 (file)
index 0000000..278d08e
Binary files /dev/null and b/textures/moretrees_spruce_sapling.png differ
diff --git a/textures/moretrees_spruce_top.png b/textures/moretrees_spruce_top.png
new file mode 100644 (file)
index 0000000..84ec816
Binary files /dev/null and b/textures/moretrees_spruce_top.png differ
diff --git a/textures/moretrees_spruce_wood.png b/textures/moretrees_spruce_wood.png
new file mode 100644 (file)
index 0000000..3b280a4
Binary files /dev/null and b/textures/moretrees_spruce_wood.png differ
diff --git a/textures/moretrees_willow.png b/textures/moretrees_willow.png
new file mode 100644 (file)
index 0000000..81d7c81
Binary files /dev/null and b/textures/moretrees_willow.png differ
diff --git a/textures/moretrees_willow_leaves.png b/textures/moretrees_willow_leaves.png
new file mode 100644 (file)
index 0000000..df1a775
Binary files /dev/null and b/textures/moretrees_willow_leaves.png differ
diff --git a/textures/moretrees_willow_sapling.png b/textures/moretrees_willow_sapling.png
new file mode 100644 (file)
index 0000000..1ebc57a
Binary files /dev/null and b/textures/moretrees_willow_sapling.png differ
diff --git a/textures/moretrees_willow_top.png b/textures/moretrees_willow_top.png
new file mode 100644 (file)
index 0000000..385da0f
Binary files /dev/null and b/textures/moretrees_willow_top.png differ
diff --git a/textures/moretrees_willow_wood.png b/textures/moretrees_willow_wood.png
new file mode 100644 (file)
index 0000000..07f90dd
Binary files /dev/null and b/textures/moretrees_willow_wood.png differ
diff --git a/tree_biomes.txt b/tree_biomes.txt
new file mode 100644 (file)
index 0000000..9b5fcad
--- /dev/null
@@ -0,0 +1,18 @@
+\r
+               Elevation       Temperature     Nearness to     Nearby  What nodes              Perlin          Avoid\r
+Tree type         (m)          (approx., °C)  some node       water   to spawn on             seed diff       radius\r
+-----------------------------------------------------------------------------------------------------------------------\r
+jungle tree    - 5 to +10       above +26      water, 15         10    dirt_with_grass         329              7\r
+fir (conifers)  above +25      -20 to +10        n/a           n/a     dirt_with_grass         359              8\r
+palm           - 1 to + 1      +18 to +32      water, 15         10    sand                    330              5\r
+apple          + 1 to +10      +23 to +32        n/a           n/a     dirt_with grass         331             15\r
+oak              0 to +10      + 4 to +16        n/a           n/a     dirt_with grass         332             15\r
+sequoia                  0 to +10      -30 to +50        n/a           n/a     dirt_with grass         333             10\r
+birch          +10 to +15      -20 to +10        n/a           n/a     dirt_with grass         334              5\r
+spruce          above +20      -20 to +10        n/a           n/a     dirt_with grass         335             10\r
+pine               n/a             n/a         water, 15          5    dirt_with grass         336             10\r
+willow         - 5 to + 5          n/a         water, 15          5    dirt_with grass         337             20\r
+rubber         - 5 to + 5       above +32      water, 15         10    dirt_with_grass         338             20\r
+\r
+beech (default)            n/a             n/a           n/a           n/a     dirt_with_grass         2               10\r
+\r
diff --git a/tree_models.lua b/tree_models.lua
new file mode 100644 (file)
index 0000000..dd78024
--- /dev/null
@@ -0,0 +1,212 @@
+beech_model={
+axiom="FFFFFBFB",
+rules_a="[&&&GGF[++^Fd][--&Fd]//Fd[+^Fd][--&Fd]]////[&&&GGF[++^Fd][--&Fd]//Fd[+^Fd][--&Fd]]////[&&&GGF[++^Fd][--&Fd]//Fd[+^Fd][--&Fdd]]",
+rules_b="[&&&F[++^Fd][--&d]//d[+^d][--&d]]////[&&&F[++^Fd][--&d]//d[+^d][--&d]]////[&&&F[++^Fd][--&Fd]//d[+^d][--&d]]",
+rules_c="/",
+rules_d="F",
+trunk="moretrees:beech_trunk",
+leaves="moretrees:beech_leaves",
+angle=30,
+iterations=2,
+random_level=0,
+trunk_type="single";
+thin_branches=true;
+}
+
+apple_tree_model={
+axiom="FFFFFAFFBF",
+rules_a="[&&&FFFFF&&FFFF][&&&++++FFFFF&&FFFF][&&&----FFFFF&&FFFF]",
+rules_b="[&&&++FFFFF&&FFFF][&&&--FFFFF&&FFFF][&&&------FFFFF&&FFFF]",
+trunk="moretrees:apple_tree_trunk",
+leaves="moretrees:apple_tree_leaves",
+angle=30,
+iterations=2,
+random_level=0,
+trunk_type="single",
+thin_branches=true;
+fruit="default:apple",
+fruit_chance=15,
+}
+
+oak_model={
+axiom="FFFFFFA",
+rules_a="[&FFBFA]////[&BFFFA]////[&FBFFA]",
+rules_b="[&FFFA]////[&FFFA]////[&FFFA]",
+trunk="moretrees:oak_trunk",
+leaves="moretrees:oak_leaves",
+angle=30,
+iterations=5,
+random_level=2,
+trunk_type="crossed";
+thin_branches=false;
+fruit="moretrees:acorn",
+fruit_chance=3,
+}
+
+sequoia_model={
+axiom="FFFFFFFFFFddccA///cccFddcFA///ddFcFA/cFFddFcdBddd/A/ccdcddd/ccAddddcFBcccAccFdFcFBcccc/BFdFFcFFdcccc/B",
+rules_a="[&&&GGF[++^FFdd][--&Fddd]//Fdd[+^Fd][--&Fdd]]////[&&&GGF[++^FFdd][--&Fddd]//Fdd[+^Fd][--&Fdd]]////[&&&GGF[++^FFdd][--&Fddd]//Fdd[+^Fd][--&Fdd]]",
+rules_b="[&&&GGF[++^Fdd][--&Fdd]//dd[+^d][--&Fd]]////[&&&GGF[++^Fdd][--&Fdd]//dd[+^d][--&Fd]]////[&&&GGF[++^Fdd][--&Fdd]//dd[+^d][--&Fd]]",
+rules_c="/",
+rules_d="F",
+trunk="moretrees:sequoia_trunk",
+leaves="moretrees:sequoia_leaves",
+angle=30,
+iterations=2,
+random_level=0,
+trunk_type="crossed",
+thin_branches=true
+}
+
+birch_model1={
+axiom="FFFFFdddccA/FFFFFFcA/FFFFFFcB",
+rules_a="[&&&dddd^^ddddddd][&&&---dddd^^ddddddd][&&&+++dddd^^ddddddd][&&&++++++dddd^^ddddddd]",
+rules_b="[&&&ddd^^ddddd][&&&---ddd^^ddddd][&&&+++ddd^^ddddd][&&&++++++ddd^^ddddd]",
+rules_c="/",
+rules_d="F",
+trunk="moretrees:birch_trunk",
+leaves="moretrees:birch_leaves",
+angle=30,
+iterations=2,
+random_level=0,
+trunk_type="single",
+thin_branches=true
+}
+
+birch_model2={
+axiom="FFFdddccA/FFFFFccA/FFFFFccB",
+rules_a="[&&&dFFF^^FFFdd][&&&---dFFF^^FFFdd][&&&+++dFFF^^FFFdd][&&&++++++dFFF^^FFFdd]",
+rules_b="[&&&dFF^^FFFd][&&&---dFFF^^FFFd][&&&+++dFF^^FFFd][&&&++++++dFF^^FFFd]",
+rules_c="/",
+rules_d="F",
+trunk="moretrees:birch_trunk",
+leaves="moretrees:birch_leaves",
+angle=30,
+iterations=2,
+random_level=0,
+trunk_type="single",
+thin_branches=true
+}
+
+palm_model={
+axiom="FFccc&FFFFFdddFA//A//A//A//A//A",
+rules_a="[&fb&bbb[++f--&ffff&ff][--f++&ffff&ff]&ffff&bbbb&b]",
+rules_b="f",
+rules_c="/",
+rules_d="F",
+trunk="moretrees:palm_trunk",
+leaves="moretrees:palm_leaves",
+angle=30,
+iterations=2,
+random_level=0,
+trunk_type="single",
+thin_branches=true,
+fruit="moretrees:coconut",
+fruit_chance=0
+}
+
+spruce_model1={
+axiom="FFFFFAFFFFFFBFFFFFFCFFFFFFDFFFFFF[&&&F^^FF][&&&++F^^FF][&&&++++F^^FF][&&&++++++F^^FF][&&&--F^^FF][&&&----F^^FF][FFFFf]",
+rules_a="[&&&FFFFFF^^FFF][&&&++FFFFFF^^FFF][&&&++++FFFFFF^^FFF][&&&++++++FFFFFF^^FFF][&&&--FFFFFF^^FFF][&&&----FFFFFF^^FFF]",
+rules_b="[&&&FFFFF^^FFF][&&&++FFFFF^^FFF][&&&++++FFFFF^^FFF][&&&++++++FFFFF^^FFF][&&&--FFFFF^^FFF][&&&----FFFFF^^FFF]",
+rules_c="[&&&FFFF^^FFF][&&&++FFFF^^FFF][&&&++++FFFF^^FFF][&&&++++++FFFF^^FFF][&&&--FFFF^^FFF][&&&----FFFF^^FFF]",
+rules_d="[&&&FFF^^FFF][&&&++FFF^^FFF][&&&++++FFF^^FFF][&&&++++++FFF^^FFF][&&&--FFF^^FFF][&&&----FFF^^FFF]",
+trunk="moretrees:spruce_trunk",
+leaves="moretrees:spruce_leaves",
+angle=30,
+iterations=2,
+random_level=0,
+trunk_type="crossed",
+thin_branches=true,
+fruit="moretrees:cone",
+fruit_chance=8
+}
+
+spruce_model2={
+axiom="FFFFFFBFFFFFFCFFFFFFDFFFFFF[&&&F^^FF][&&&++F^^FF][&&&++++F^^FF][&&&++++++F^^FF][&&&--F^^FF][&&&----F^^FF][FFFFf]",
+rules_b="[&&&FFFFF^^FFF][&&&++FFFFF^^FFF][&&&++++FFFFF^^FFF][&&&++++++FFFFF^^FFF][&&&--FFFFF^^FFF][&&&----FFFFF^^FFF]",
+rules_c="[&&&FFFF^^FFF][&&&++FFFF^^FFF][&&&++++FFFF^^FFF][&&&++++++FFFF^^FFF][&&&--FFFF^^FFF][&&&----FFFF^^FFF]",
+rules_d="[&&&FFF^^FFF][&&&++FFF^^FFF][&&&++++FFF^^FFF][&&&++++++FFF^^FFF][&&&--FFF^^FFF][&&&----FFF^^FFF]",
+trunk="moretrees:spruce_trunk",
+leaves="moretrees:spruce_leaves",
+angle=30,
+iterations=2,
+random_level=0,
+trunk_type="crossed",
+thin_branches=true,
+fruit="moretrees:cone",
+fruit_chance=8
+}
+
+pine_model={
+axiom="FFFFFcccdddB///cFdFB////cFdFB///cFdFB///cFdFA///cFdFA///cFdFB[FF]f",
+rules_a="[&&&TTTT[++^TFdd][--&TFd]//Tdd[+^Fd][--&Fdd]]",
+rules_b="[&&&TTT[++^Fdd][--&Fdd]//dd[+^d][--&Fd]]",
+rules_c="/",
+rules_d="F",
+trunk="moretrees:pine_trunk",
+leaves="moretrees:pine_leaves",
+angle=30,
+iterations=2,
+random_level=0,
+trunk_type="single",
+thin_branches=true,
+fruit="moretrees:pine_cone",
+fruit_chance=8
+}
+
+willow_model={
+axiom="FFFFFFFFccA",
+rules_a="[&FF&FFFF&&F&FFFFFFFdddd][**&FF&FFFF&&F&FFFFFFFdddd][//&FF&FFFF&&F&FFFFFFFdddd][////&FF&FFFF&&F&FFFFFFFdddd][//////&FF&FFFF&&F&FFFFFFFdddd][////////&FF&FFFF&&F&FFFFFFFdddd]",
+rules_c="/",
+rules_d="F",
+trunk="moretrees:willow_trunk",
+leaves="moretrees:willow_leaves",
+angle=30,
+iterations=2,
+random_level=0,
+trunk_type="crossed",
+thin_branches=true
+}
+
+rubber_tree={
+axiom="FFFFA",
+rules_a="[&FFBFA]////[&BFFFA]////[&FBFFA]",
+rules_b="[&FFA]////[&FFA]////[&FFA]",
+trunk="moretrees:rubber_tree_trunk",
+leaves="moretrees:rubber_tree_leaves",
+angle=35,
+iterations=3,
+random_level=1,
+trunk_type="double",
+thin_branches=true
+}
+
+moretrees.jungletree_model={
+       axiom=nil,
+       rules_a=nil,
+       rules_b=nil,
+       trunk="default:jungletree",
+       leaves="jungletree:leaves_green",
+       leaves2=nil,
+       leaves2_chance=nil,
+       angle=45,
+       iterations=nil,
+       random_level=2,
+       trunk_type=nil,
+       thin_branches=true;
+       fruit_chance=15,
+       fruit="vines:vine"
+}
+
+moretrees.conifer_model={
+       axiom="FFFAF[&&-F][&&+F][&&---F][&&+++F]Fff",
+       rules_a=nil,
+       rules_b=nil,
+       trunk="conifers:trunk",
+       leaves=nil,
+       angle=45,
+       iterations=7,
+       random_level=5,
+       thin_trunks=true
+}