Browse Source

Add poplar tree

Poplars exist in two kinds: small and large trees. Both use the same
nodes, except for the sapling. Poplar leaves may drop one or the
other sapling.

Poplar trees require a humid environment, and water nearby.
Provided there is water, an occasional poplar will grow under less humid
conditions.
tags/2018-11-09
Rogier 4 years ago
parent
commit
d72574d288
14 changed files with 179 additions and 2 deletions
  1. +3
    -2
      LICENSE
  2. +91
    -0
      biome_defs.lua
  3. +1
    -0
      default_settings.txt
  4. +12
    -0
      init.lua
  5. +40
    -0
      node_defs.lua
  6. BIN
      textures/moretrees_poplar_leaves.png
  7. BIN
      textures/moretrees_poplar_sapling.png
  8. BIN
      textures/moretrees_poplar_small_sapling.png
  9. BIN
      textures/moretrees_poplar_trunk-1.png
  10. BIN
      textures/moretrees_poplar_trunk.png
  11. BIN
      textures/moretrees_poplar_trunk_top.png
  12. BIN
      textures/moretrees_poplar_wood.png
  13. +1
    -0
      tree_biomes.txt
  14. +31
    -0
      tree_models.lua

+ 3
- 2
LICENSE View File

@@ -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:


+ 91
- 0
biome_defs.lua View File

@@ -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,


+ 1
- 0
default_settings.txt View File

@@ -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


+ 12
- 0
init.lua View File

@@ -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)


+ 40
- 0
node_defs.lua View File

@@ -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"}


BIN
textures/moretrees_poplar_leaves.png View File

Before After
Width: 16  |  Height: 16  |  Size: 563B

BIN
textures/moretrees_poplar_sapling.png View File

Before After
Width: 16  |  Height: 16  |  Size: 447B

BIN
textures/moretrees_poplar_small_sapling.png View File

Before After
Width: 16  |  Height: 16  |  Size: 347B

BIN
textures/moretrees_poplar_trunk-1.png View File

Before After
Width: 16  |  Height: 16  |  Size: 1.2KB

BIN
textures/moretrees_poplar_trunk.png View File

Before After
Width: 16  |  Height: 16  |  Size: 980B

BIN
textures/moretrees_poplar_trunk_top.png View File

Before After
Width: 16  |  Height: 16  |  Size: 751B

BIN
textures/moretrees_poplar_wood.png View File

Before After
Width: 16  |  Height: 16  |  Size: 726B

+ 1
- 0
tree_biomes.txt View File

@@ -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


+ 31
- 0
tree_models.lua View File

@@ -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]]",


Loading…
Cancel
Save