summaryrefslogtreecommitdiffstats
path: root/src/Generating/Trees.cpp
diff options
context:
space:
mode:
authorJames Balajan <jbalajan@gmail.com>2016-12-02 10:52:29 +0100
committerMattes D <github@xoft.cz>2016-12-02 10:52:29 +0100
commitdf5be57c1e829e6008b9f7825331c07ba0b406de (patch)
treecd5090d51e7bfecd988d59cec01790b3d10dce9b /src/Generating/Trees.cpp
parentMerge pull request #3468 from cuberite/FixVillageGen (diff)
downloadcuberite-df5be57c1e829e6008b9f7825331c07ba0b406de.tar
cuberite-df5be57c1e829e6008b9f7825331c07ba0b406de.tar.gz
cuberite-df5be57c1e829e6008b9f7825331c07ba0b406de.tar.bz2
cuberite-df5be57c1e829e6008b9f7825331c07ba0b406de.tar.lz
cuberite-df5be57c1e829e6008b9f7825331c07ba0b406de.tar.xz
cuberite-df5be57c1e829e6008b9f7825331c07ba0b406de.tar.zst
cuberite-df5be57c1e829e6008b9f7825331c07ba0b406de.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/Trees.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Generating/Trees.cpp b/src/Generating/Trees.cpp
index c185f54d9..f90a5c9c3 100644
--- a/src/Generating/Trees.cpp
+++ b/src/Generating/Trees.cpp
@@ -602,6 +602,15 @@ void GetDarkoakTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_No
a_LogBlocks.push_back(sSetBlock(a_BlockX + 1, a_BlockY + i, a_BlockZ + 1, E_BLOCK_NEW_LOG, E_META_NEW_LOG_DARK_OAK_WOOD));
}
+ // Prevent floating trees by placing dirt under them
+ for (int i = 1; i < 5; i++)
+ {
+ a_OtherBlocks.push_back(sSetBlock(a_BlockX, a_BlockY - i, a_BlockZ, E_BLOCK_DIRT, E_META_DIRT_NORMAL));
+ a_OtherBlocks.push_back(sSetBlock(a_BlockX + 1, a_BlockY - i, a_BlockZ, E_BLOCK_DIRT, E_META_DIRT_NORMAL));
+ a_OtherBlocks.push_back(sSetBlock(a_BlockX, a_BlockY - i, a_BlockZ + 1, E_BLOCK_DIRT, E_META_DIRT_NORMAL));
+ a_OtherBlocks.push_back(sSetBlock(a_BlockX + 1, a_BlockY - i, a_BlockZ + 1, E_BLOCK_DIRT, E_META_DIRT_NORMAL));
+ }
+
// Create branches
for (int i = 0; i < 3; i++)
{
@@ -966,6 +975,15 @@ void GetLargeJungleTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise &
}
int hei = a_BlockY + Height - 2;
+ // Prevent floating trees by placing dirt under them
+ for (int i = 1; i < 5; i++)
+ {
+ a_OtherBlocks.push_back(sSetBlock(a_BlockX, a_BlockY - i, a_BlockZ, E_BLOCK_DIRT, E_META_DIRT_NORMAL));
+ a_OtherBlocks.push_back(sSetBlock(a_BlockX + 1, a_BlockY - i, a_BlockZ, E_BLOCK_DIRT, E_META_DIRT_NORMAL));
+ a_OtherBlocks.push_back(sSetBlock(a_BlockX, a_BlockY - i, a_BlockZ + 1, E_BLOCK_DIRT, E_META_DIRT_NORMAL));
+ a_OtherBlocks.push_back(sSetBlock(a_BlockX + 1, a_BlockY - i, a_BlockZ + 1, E_BLOCK_DIRT, E_META_DIRT_NORMAL));
+ }
+
// Put vines around the lowermost leaves layer:
PushSomeColumns(a_BlockX, hei, a_BlockZ, Height, a_Seq, a_Noise, 0x3fffffff, a_OtherBlocks, Vines, ARRAYCOUNT(Vines), E_BLOCK_VINES);