summaryrefslogtreecommitdiff
path: root/src/content_abm.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2013-03-16 17:06:11 -0400
committerkwolekr <kwolekr@minetest.net>2013-03-16 17:06:11 -0400
commit6823ce99a7deabe410dd8b143b688cd364490cec (patch)
treeeee1243f8c1e10f240abcda7a0c25abe08483665 /src/content_abm.cpp
parent1f1ad9fd23b07a1c1b5477ee0dbf2c4fdaabccef (diff)
downloadminetest-6823ce99a7deabe410dd8b143b688cd364490cec.tar.gz
minetest-6823ce99a7deabe410dd8b143b688cd364490cec.tar.bz2
minetest-6823ce99a7deabe410dd8b143b688cd364490cec.zip
Re-add jungles, apple trees
Diffstat (limited to 'src/content_abm.cpp')
-rw-r--r--src/content_abm.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/content_abm.cpp b/src/content_abm.cpp
index a88450095..e50edddd7 100644
--- a/src/content_abm.cpp
+++ b/src/content_abm.cpp
@@ -99,6 +99,7 @@ public:
{
std::set<std::string> s;
s.insert("sapling");
+ s.insert("junglesapling");
return s;
}
virtual float getTriggerInterval()
@@ -111,16 +112,25 @@ public:
INodeDefManager *ndef = env->getGameDef()->ndef();
ServerMap *map = &env->getServerMap();
- actionstream<<"A sapling grows into a tree at "
- <<PP(p)<<std::endl;
+ bool is_jungle_tree = n.getContent() == ndef->getId("junglesapling");
+
+ actionstream <<"A " << (is_jungle_tree ? "jungle " : "")
+ << "sapling grows into a tree at "
+ << PP(p) << std::endl;
std::map<v3s16, MapBlock*> modified_blocks;
v3s16 tree_p = p;
ManualMapVoxelManipulator vmanip(map);
v3s16 tree_blockp = getNodeBlockPos(tree_p);
vmanip.initialEmerge(tree_blockp - v3s16(1,1,1), tree_blockp + v3s16(1,1,1));
- bool is_apple_tree = myrand()%4 == 0;
- treegen::make_tree(vmanip, tree_p, is_apple_tree, ndef, myrand());
+
+ if (is_jungle_tree) {
+ treegen::make_jungletree(vmanip, tree_p, ndef, myrand());
+ } else {
+ bool is_apple_tree = myrand() % 4 == 0;
+ treegen::make_tree(vmanip, tree_p, is_apple_tree, ndef, myrand());
+ }
+
vmanip.blitBackAll(&modified_blocks);
// update lighting