summaryrefslogtreecommitdiff
path: root/sapling.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-07-14 13:40:49 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2016-07-14 13:40:49 +0100
commitf092e5fcb25f1d19317fa9903f400b76f18929fc (patch)
treed193db647357e811ae6b30befb3645d295b76b4e /sapling.lua
parenteecf187cc28b0e7e1178c0d302ecfa09b93fa3be (diff)
Redone enough_height changes to use node setting
Diffstat (limited to 'sapling.lua')
-rw-r--r--sapling.lua38
1 files changed, 16 insertions, 22 deletions
diff --git a/sapling.lua b/sapling.lua
index e309302..2cf34b8 100644
--- a/sapling.lua
+++ b/sapling.lua
@@ -154,60 +154,54 @@ ethereal.grow_sapling = function (pos, node)
local height = minetest.registered_nodes[node.name].grown_height
+ -- do we have enough height to grow sapling into tree?
+ if not height or not enough_height(pos, height) then
+ return
+ end
+
-- Check if Ethereal Sapling is growing on correct substrate
if node.name == "ethereal:yellow_tree_sapling"
- and under == "default:dirt_with_snow"
- and enough_height(pos, height) then
+ and under == "default:dirt_with_snow" then
ethereal.grow_yellow_tree(pos)
elseif node.name == "ethereal:big_tree_sapling"
- and under == "ethereal:green_dirt"
- and enough_height(pos, height) then
+ and under == "ethereal:green_dirt" then
ethereal.grow_big_tree(pos)
elseif node.name == "ethereal:banana_tree_sapling"
- and under == "ethereal:grove_dirt"
- and enough_height(pos, height) then
+ and under == "ethereal:grove_dirt" then
ethereal.grow_banana_tree(pos)
elseif node.name == "ethereal:frost_tree_sapling"
- and under == "ethereal:crystal_dirt"
- and enough_height(pos, height) then
+ and under == "ethereal:crystal_dirt" then
ethereal.grow_frost_tree(pos)
elseif node.name == "ethereal:mushroom_sapling"
- and under == "ethereal:mushroom_dirt"
- and enough_height(pos, height) then
+ and under == "ethereal:mushroom_dirt" then
ethereal.grow_mushroom_tree(pos)
elseif node.name == "ethereal:palm_sapling"
- and under == "default:sand"
- and enough_height(pos, height) then
+ and under == "default:sand" then
ethereal.grow_palm_tree(pos)
elseif node.name == "ethereal:willow_sapling"
- and under == "ethereal:gray_dirt"
- and enough_height(pos, height) then
+ and under == "ethereal:gray_dirt" then
ethereal.grow_willow_tree(pos)
elseif node.name == "ethereal:redwood_sapling"
- and under == "bakedclay:red"
- and enough_height(pos, height) then
+ and under == "bakedclay:red" then
ethereal.grow_redwood_tree(pos)
elseif node.name == "ethereal:orange_tree_sapling"
- and under == "ethereal:prairie_dirt"
- and enough_height(pos, height) then
+ and under == "ethereal:prairie_dirt" then
ethereal.grow_orange_tree(pos)
elseif node.name == "ethereal:bamboo_sprout"
- and under == "ethereal:bamboo_dirt"
- and enough_height(pos, height) then
+ and under == "ethereal:bamboo_dirt" then
ethereal.grow_bamboo_tree(pos)
elseif node.name == "ethereal:birch_sapling"
- and under == "ethereal:green_dirt"
- and enough_height(pos, height) then
+ and under == "ethereal:green_dirt" then
ethereal.grow_birch_tree(pos)
end