summaryrefslogtreecommitdiff
path: root/ferns/gianttreefern.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-03-14 21:24:35 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-03-14 21:24:35 -0400
commit6c701f9b7cf88fcb026a8f38d8852bd8a54412c7 (patch)
treefea375cbf160bd4e42792257947373b3e6345898 /ferns/gianttreefern.lua
parentb627f5dbf691c2d478d620e38e8ce1823289866e (diff)
downloaddreambuilder_modpack-6c701f9b7cf88fcb026a8f38d8852bd8a54412c7.tar
dreambuilder_modpack-6c701f9b7cf88fcb026a8f38d8852bd8a54412c7.tar.gz
dreambuilder_modpack-6c701f9b7cf88fcb026a8f38d8852bd8a54412c7.tar.bz2
dreambuilder_modpack-6c701f9b7cf88fcb026a8f38d8852bd8a54412c7.tar.xz
dreambuilder_modpack-6c701f9b7cf88fcb026a8f38d8852bd8a54412c7.zip
update plantlife modpack (ferns)
Diffstat (limited to 'ferns/gianttreefern.lua')
-rw-r--r--ferns/gianttreefern.lua47
1 files changed, 27 insertions, 20 deletions
diff --git a/ferns/gianttreefern.lua b/ferns/gianttreefern.lua
index bc6516b..f6ef9f3 100644
--- a/ferns/gianttreefern.lua
+++ b/ferns/gianttreefern.lua
@@ -61,32 +61,39 @@ abstract_ferns.grow_giant_tree_fern = function(pos)
}
}
+ local brk = false
for i = 1, size-3 do
+ if minetest.get_node({x = pos.x, y = pos.y + i, z = pos.z}).name ~= "air" then
+ brk = true
+ break
+ end
minetest.set_node({x = pos.x, y = pos.y + i, z = pos.z}, {name="ferns:fern_trunk_big"})
end
- minetest.set_node({x = pos.x, y = pos.y + size-2, z = pos.z}, {name="ferns:fern_trunk_big_top"})
- minetest.set_node({x = pos.x, y = pos.y + size-1, z = pos.z}, {name="ferns:tree_fern_leaves_giant"})
+ if not brk then
+ minetest.set_node({x = pos.x, y = pos.y + size-2, z = pos.z}, {name="ferns:fern_trunk_big_top"})
+ minetest.set_node({x = pos.x, y = pos.y + size-1, z = pos.z}, {name="ferns:tree_fern_leaves_giant"})
- -- all the checking for air below is to prevent some ugly bugs (incomplete trunks of neighbouring trees), it's a bit slower, but worth the result
+ -- all the checking for air below is to prevent some ugly bugs (incomplete trunks of neighbouring trees), it's a bit slower, but worth the result
- -- assert(#leafchecks == 4)
- for i = 1, 4 do
- local positions = leafchecks[i].positions
- local rot = leafchecks[i].direction
- local endpos = 4 -- If the loop below adds all intermediate leaves then the "terminating" leaf will be at positions[4]
- -- assert(#positions == 4)
- -- add leaves so long as the destination nodes are air
- for j = 1, 3 do
- if minetest.get_node(positions[j]).name == "air" then
- minetest.set_node(positions[j], {name="ferns:tree_fern_leave_big"})
- else
- endpos = j
- break
+ -- assert(#leafchecks == 4)
+ for i = 1, 4 do
+ local positions = leafchecks[i].positions
+ local rot = leafchecks[i].direction
+ local endpos = 4 -- If the loop below adds all intermediate leaves then the "terminating" leaf will be at positions[4]
+ -- assert(#positions == 4)
+ -- add leaves so long as the destination nodes are air
+ for j = 1, 3 do
+ if minetest.get_node(positions[j]).name == "air" then
+ minetest.set_node(positions[j], {name="ferns:tree_fern_leave_big"})
+ else
+ endpos = j
+ break
+ end
+ end
+ -- add the terminating leaf if required and possible
+ if endpos == 4 and minetest.get_node(positions[endpos]).name == "air" then
+ minetest.set_node(positions[endpos], {name="ferns:tree_fern_leave_big_end", param2=rot})
end
- end
- -- add the terminating leaf if required and possible
- if endpos == 4 and minetest.get_node(positions[endpos]).name == "air" then
- minetest.set_node(positions[endpos], {name="ferns:tree_fern_leave_big_end", param2=rot})
end
end
end