summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-07-03 04:52:27 -0400
committerGitHub <noreply@github.com>2016-07-03 04:52:27 -0400
commit5735554d6abcb7939c614ac3197f8207d5564be7 (patch)
treed37859050c821b7a226ce1bf97f6f942940816ae
parent8aa4888deefb6d1f6e380763ca662018a82b767f (diff)
parentd72574d28835e30e9d7fa7644268876e6920421a (diff)
Merge pull request #26 from Rogier-5/poplar
Add poplar tree
-rw-r--r--LICENSE5
-rw-r--r--biome_defs.lua91
-rw-r--r--default_settings.txt1
-rw-r--r--init.lua12
-rw-r--r--node_defs.lua40
-rw-r--r--textures/moretrees_poplar_leaves.pngbin0 -> 563 bytes
-rw-r--r--textures/moretrees_poplar_sapling.pngbin0 -> 447 bytes
-rw-r--r--textures/moretrees_poplar_small_sapling.pngbin0 -> 347 bytes
-rw-r--r--textures/moretrees_poplar_trunk-1.pngbin0 -> 1217 bytes
-rw-r--r--textures/moretrees_poplar_trunk.pngbin0 -> 980 bytes
-rw-r--r--textures/moretrees_poplar_trunk_top.pngbin0 -> 751 bytes
-rw-r--r--textures/moretrees_poplar_wood.pngbin0 -> 726 bytes
-rw-r--r--tree_biomes.txt1
-rw-r--r--tree_models.lua31
14 files changed, 179 insertions, 2 deletions
diff --git a/LICENSE b/LICENSE
index 7cffc99..ecc5c14 100644
--- a/LICENSE
+++ b/LICENSE
@@ -7,13 +7,14 @@ All source code:
Date & cocos palm code (date_palm.lua, cocos_palm.lua)
© 2016, Rogier <rogier777@gmail.com>
Published under the terms and conditions of the WTFPL.
-All date & date palm textures, date-based food, cocos flower & green coconuts:
+All date & date palm textures, date-based food, cocos flower & green coconuts,
+and all poplar textures:
© 2016, Rogier <rogier777@gmail.com>
Published under the terms and conditions of CC-BY-SA-3.0 Unported.
- Three of the date palm textures are modifications of existing moretrees textures
- The green coconuts are a modification of the brown coconut
- The date cake batter is a modification of the acorn muffin batter
-All sapling textures (textures/*_sapling.png):
+All other sapling textures (textures/*_sapling.png):
© 2013, Tim Huppertz <mitroman@naturalnet.de>
Published under the terms and conditions of CC-BY-SA-3.0 Unported.
All other textures:
diff --git a/biome_defs.lua b/biome_defs.lua
index 46228f5..463f4b8 100644
--- a/biome_defs.lua
+++ b/biome_defs.lua
@@ -196,6 +196,97 @@ moretrees.cedar_biome = {
max_count = 10,
}
+
+-- Poplar requires a lot of water.
+moretrees.poplar_biome = {
+ surface = "default:dirt_with_grass",
+ avoid_nodes = moretrees.avoidnodes,
+ avoid_radius = 6,
+ seed_diff = 341,
+ min_elevation = 0,
+ max_elevation = 50,
+ near_nodes = {"default:water_source"},
+ near_nodes_size = 15,
+ near_nodes_vertical = 5,
+ near_nodes_count = 1,
+ humidity_min = -0.7,
+ humidity_max = -1,
+ rarity = 50,
+ max_count = 15,
+}
+
+-- The humidity requirement it quite restrictive (apparently).
+-- Spawn an occasional poplar elsewhere.
+moretrees.poplar_biome_2 = {
+ surface = "default:dirt_with_grass",
+ avoid_nodes = moretrees.avoidnodes,
+ avoid_radius = 6,
+ seed_diff = 341,
+ min_elevation = 0,
+ max_elevation = 50,
+ near_nodes = {"default:water_source"},
+ near_nodes_size = 15,
+ near_nodes_vertical = 4,
+ near_nodes_count = 10,
+ humidity_min = 0.1,
+ humidity_max = -0.6,
+ rarity = 50,
+ max_count = 1,
+}
+
+-- Subterranean lakes provide enough water for poplars to grow
+moretrees.poplar_biome_3 = {
+ surface = "default:dirt_with_grass",
+ avoid_nodes = moretrees.avoidnodes,
+ avoid_radius = 6,
+ seed_diff = 342,
+ min_elevation = 0,
+ max_elevation = 50,
+ near_nodes = {"default:water_source"},
+ near_nodes_size = 1,
+ near_nodes_vertical = 25,
+ near_nodes_count = 1,
+ humidity_min = -0.5,
+ humidity_max = -1,
+ rarity = 0,
+ max_count = 30,
+}
+
+moretrees.poplar_small_biome = {
+ surface = "default:dirt_with_grass",
+ avoid_nodes = moretrees.avoidnodes,
+ avoid_radius = 4,
+ seed_diff = 343,
+ min_elevation = 0,
+ max_elevation = 50,
+ near_nodes = {"default:water_source"},
+ near_nodes_size = 10,
+ near_nodes_vertical = 5,
+ near_nodes_count = 1,
+ humidity_min = -0.7,
+ humidity_max = -1,
+ rarity = 50,
+ max_count = 10,
+}
+
+moretrees.poplar_small_biome_2 = {
+ surface = "default:dirt_with_grass",
+ avoid_nodes = moretrees.avoidnodes,
+ avoid_radius = 4,
+ seed_diff = 343,
+ min_elevation = 0,
+ max_elevation = 50,
+ near_nodes = {"default:water_source"},
+ near_nodes_size = 10,
+ near_nodes_vertical = 4,
+ near_nodes_count = 5,
+ humidity_min = 0.1,
+ humidity_max = -0.6,
+ rarity = 50,
+ max_count = 3,
+}
+
+
moretrees.fir_biome = {
surface = "default:dirt_with_grass",
avoid_nodes = moretrees.avoidnodes,
diff --git a/default_settings.txt b/default_settings.txt
index 0a5fc88..257baec 100644
--- a/default_settings.txt
+++ b/default_settings.txt
@@ -15,6 +15,7 @@ moretrees.enable_birch = true
moretrees.enable_spruce = true
moretrees.enable_jungle_tree = true
moretrees.enable_fir = true
+moretrees.enable_poplar = true
moretrees.enable_beech = false
-- set this to true to make moretrees spawn saplings at mapgen time instead
diff --git a/init.lua b/init.lua
index 2c50fd9..8189ffd 100644
--- a/init.lua
+++ b/init.lua
@@ -97,6 +97,8 @@ if moretrees.spawn_saplings then
moretrees.spawn_jungletree_object = "moretrees:jungletree_sapling_ongen"
moretrees.spawn_fir_object = "moretrees:fir_sapling_ongen"
moretrees.spawn_fir_snow_object = "snow:sapling_pine"
+ moretrees.spawn_poplar_object = "moretrees:poplar_sapling_ongen"
+ moretrees.spawn_poplar_small_object = "moretrees:poplar_small_sapling_ongen"
else
moretrees.spawn_beech_object = moretrees.beech_model
moretrees.spawn_apple_tree_object = moretrees.apple_tree_model
@@ -113,6 +115,8 @@ else
moretrees.spawn_jungletree_object = "moretrees.grow_jungletree"
moretrees.spawn_fir_object = "moretrees.grow_fir"
moretrees.spawn_fir_snow_object = "moretrees.grow_fir_snow"
+ moretrees.spawn_poplar_object = moretrees.poplar_model
+ moretrees.spawn_poplar_small_object = moretrees.poplar_small_model
end
if moretrees.enable_beech then
@@ -175,6 +179,14 @@ if moretrees.enable_fir then
end
end
+if moretrees.enable_poplar then
+ biome_lib:register_generate_plant(moretrees.poplar_biome, moretrees.spawn_poplar_object)
+ biome_lib:register_generate_plant(moretrees.poplar_biome_2, moretrees.spawn_poplar_object)
+ biome_lib:register_generate_plant(moretrees.poplar_biome_3, moretrees.spawn_poplar_object)
+ biome_lib:register_generate_plant(moretrees.poplar_small_biome, moretrees.spawn_poplar_small_object)
+ biome_lib:register_generate_plant(moretrees.poplar_small_biome_2, moretrees.spawn_poplar_small_object)
+end
+
-- Code to spawn a birch tree
function moretrees.grow_birch(pos)
diff --git a/node_defs.lua b/node_defs.lua
index b1df5f7..1c0796b 100644
--- a/node_defs.lua
+++ b/node_defs.lua
@@ -12,6 +12,8 @@ moretrees.treelist = {
{"date_palm", "Date Palm Tree", "date_palm_fruit_trunk", "Date Palm Tree", {0, 0, 0, 0, 0, 0}, 0.0 },
{"spruce", "Spruce Tree", "spruce_cone", "Spruce Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
{"cedar", "Cedar Tree", "cedar_cone", "Cedar Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
+ {"poplar", "Poplar Tree"},
+ {"poplar_small", "Poplar Tree"},
{"willow", "Willow Tree"},
{"rubber_tree", "Rubber Tree"},
{"fir", "Douglas Fir", "fir_cone", "Fir Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
@@ -72,6 +74,7 @@ for i in ipairs(moretrees.treelist) do
if treename ~= "jungletree" -- the default game provides jungle tree, acacia, and pine trunk/planks nodes.
and treename ~= "acacia"
+ and treename ~= "poplar_small"
and treename ~= "pine" then
saptex = "moretrees_"..treename.."_sapling.png"
@@ -273,6 +276,43 @@ for i in ipairs(moretrees.treelist) do
end
end
+-- Add small poplar saplings
+
+local poplar_sapling = minetest.registered_nodes["moretrees:poplar_sapling"]
+local poplar_sapling_ongen = minetest.registered_nodes["moretrees:poplar_sapling_ongen"]
+local poplar_small_sapling = {}
+local poplar_small_sapling_ongen = {}
+for k,v in pairs(poplar_sapling) do
+ poplar_small_sapling[k] = v
+end
+for k,v in pairs(poplar_sapling_ongen) do
+ poplar_small_sapling_ongen[k] = v
+end
+poplar_small_sapling.tiles = {"moretrees_poplar_small_sapling.png"}
+poplar_small_sapling.inventory_image = "moretrees_poplar_small_sapling.png"
+poplar_small_sapling_ongen.tiles_ongen = {"moretrees_poplar_small_sapling.png"}
+poplar_small_sapling_ongen.inventory_image_ongen = "moretrees_poplar_small_sapling.png"
+poplar_small_sapling_ongen.drop = "moretrees:poplar_small_sapling"
+minetest.register_node("moretrees:poplar_small_sapling", poplar_small_sapling)
+minetest.register_node("moretrees:poplar_small_sapling_ongen", poplar_small_sapling_ongen)
+if moretrees.spawn_saplings then
+ table.insert(moretrees.avoidnodes, "moretrees:poplar_sapling")
+ table.insert(moretrees.avoidnodes, "moretrees:poplar_small_sapling_ongen")
+end
+
+local poplar_leaves_drop = minetest.registered_nodes["moretrees:poplar_leaves"].drop
+minetest.override_item("moretrees:poplar_leaves", {
+ drop = {
+ max_items = poplar_leaves_drop.maxitems,
+ items = {
+ {items = {"moretrees:poplar_sapling"}, rarity = 1.33 * poplar_leaves_drop.items[1].rarity },
+ {items = {"moretrees:poplar_small_sapling"}, rarity = 1.33 * poplar_leaves_drop.items[1].rarity },
+ {items = {"moretrees:poplar_leaves"} }
+ }
+ }
+})
+
+
-- Extra nodes for jungle trees:
local jungleleaves = {"yellow","red"}
diff --git a/textures/moretrees_poplar_leaves.png b/textures/moretrees_poplar_leaves.png
new file mode 100644
index 0000000..64568bc
--- /dev/null
+++ b/textures/moretrees_poplar_leaves.png
Binary files differ
diff --git a/textures/moretrees_poplar_sapling.png b/textures/moretrees_poplar_sapling.png
new file mode 100644
index 0000000..9d5f32a
--- /dev/null
+++ b/textures/moretrees_poplar_sapling.png
Binary files differ
diff --git a/textures/moretrees_poplar_small_sapling.png b/textures/moretrees_poplar_small_sapling.png
new file mode 100644
index 0000000..fb9bd03
--- /dev/null
+++ b/textures/moretrees_poplar_small_sapling.png
Binary files differ
diff --git a/textures/moretrees_poplar_trunk-1.png b/textures/moretrees_poplar_trunk-1.png
new file mode 100644
index 0000000..e4e1540
--- /dev/null
+++ b/textures/moretrees_poplar_trunk-1.png
Binary files differ
diff --git a/textures/moretrees_poplar_trunk.png b/textures/moretrees_poplar_trunk.png
new file mode 100644
index 0000000..47672fb
--- /dev/null
+++ b/textures/moretrees_poplar_trunk.png
Binary files differ
diff --git a/textures/moretrees_poplar_trunk_top.png b/textures/moretrees_poplar_trunk_top.png
new file mode 100644
index 0000000..4c55858
--- /dev/null
+++ b/textures/moretrees_poplar_trunk_top.png
Binary files differ
diff --git a/textures/moretrees_poplar_wood.png b/textures/moretrees_poplar_wood.png
new file mode 100644
index 0000000..55e6b44
--- /dev/null
+++ b/textures/moretrees_poplar_wood.png
Binary files differ
diff --git a/tree_biomes.txt b/tree_biomes.txt
index 22e1032..0dd0345 100644
--- a/tree_biomes.txt
+++ b/tree_biomes.txt
@@ -18,6 +18,7 @@ willow - 5 to + 5 n/a water, 15 5 dirt_with grass 337 20
acacia n/a n/a n/a n/a dirt_with_grass,
desert_sand n/a 15
rubber - 5 to + 5 above +32 water, 15 10 dirt_with_grass 338 20
+poplar n/a -10 to +26 water, 15h,5v 1 dirt_with_grass 341,342,343 10
beech n/a n/a n/a n/a dirt_with_grass 2 10
diff --git a/tree_models.lua b/tree_models.lua
index 791bddb..9372fe9 100644
--- a/tree_models.lua
+++ b/tree_models.lua
@@ -43,6 +43,37 @@ moretrees.oak_model={
fruit_chance=3,
}
+moretrees.poplar_model={
+ axiom="TTTaaBCCCCCCCCCCCcccBBB[[f]&&G++f++Gf++Gf++Gf++G--]G[[f]&&G++f++Gf++Gf++Gf++G--]Gff",
+ rules_a="T",
+ rules_b="[[T]&&G++f++ff++ff++ff++f--]G",
+ rules_c="[[T]&&G++f++ff++ff++ff++f--G++[d]G[d]G++G[d]G[d]G[d]G++G[d]G[d]G[d]G++G[d]G[d]G[d]G++G[d]G]G",
+ rules_d="f",
+ trunk="air",
+ trunk="moretrees:poplar_trunk",
+ leaves="moretrees:poplar_leaves",
+ angle=45,
+ iterations=0,
+ random_level=0,
+ trunk_type="single",
+ thin_branches=false,
+}
+
+moretrees.poplar_small_model={
+ axiom="TT[T]BCCCCccBBff",
+ rules_a="T",
+ rules_b="[[f]&&G++f++Gf++Gf++Gf++G--]G",
+ rules_c="[[T]&&G++f++[d]Gf++[d]Gf++[d]Gf++[d]G--]G",
+ rules_d="f",
+ trunk="moretrees:poplar_trunk",
+ leaves="moretrees:poplar_leaves",
+ angle=45,
+ iterations=0,
+ random_level=0,
+ trunk_type="single",
+ thin_branches=false,
+}
+
moretrees.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]]",