diff options
author | Rogier <rogier777@gmail.com> | 2016-07-01 16:06:29 +0200 |
---|---|---|
committer | Rogier <rogier777@gmail.com> | 2016-07-03 07:16:36 +0200 |
commit | d72574d28835e30e9d7fa7644268876e6920421a (patch) | |
tree | d37859050c821b7a226ce1bf97f6f942940816ae /node_defs.lua | |
parent | 8aa4888deefb6d1f6e380763ca662018a82b767f (diff) |
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.
Diffstat (limited to 'node_defs.lua')
-rw-r--r-- | node_defs.lua | 40 |
1 files changed, 40 insertions, 0 deletions
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"} |