diff options
author | STRWarrior <niels.breuker@hotmail.nl> | 2014-07-20 16:23:45 +0200 |
---|---|---|
committer | STRWarrior <niels.breuker@hotmail.nl> | 2014-07-20 16:23:45 +0200 |
commit | 7bf9da74413c69cbd79a9db81ba098e13b847904 (patch) | |
tree | e70ab8bf3ac4824cac31ae28e2f77eaa12ecdc33 /src/Generating/FinishGen.cpp | |
parent | Pass cItem by reference. (diff) | |
download | cuberite-7bf9da74413c69cbd79a9db81ba098e13b847904.tar cuberite-7bf9da74413c69cbd79a9db81ba098e13b847904.tar.gz cuberite-7bf9da74413c69cbd79a9db81ba098e13b847904.tar.bz2 cuberite-7bf9da74413c69cbd79a9db81ba098e13b847904.tar.lz cuberite-7bf9da74413c69cbd79a9db81ba098e13b847904.tar.xz cuberite-7bf9da74413c69cbd79a9db81ba098e13b847904.tar.zst cuberite-7bf9da74413c69cbd79a9db81ba098e13b847904.zip |
Diffstat (limited to 'src/Generating/FinishGen.cpp')
-rw-r--r-- | src/Generating/FinishGen.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp index f2d66af70..06c1dcbbe 100644 --- a/src/Generating/FinishGen.cpp +++ b/src/Generating/FinishGen.cpp @@ -160,6 +160,38 @@ void cFinishGenNetherClumpFoliage::TryPlaceClump(cChunkDesc & a_ChunkDesc, int a /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// cFinishGenFoliage: + +void cFinishGenFoliage::GenFinish(cChunkDesc & a_ChunkDesc) +{ + for (int x = 1; x < cChunkDef::Width; x++) + { + int xx = x + a_ChunkDesc.GetChunkX(); + for (int z = 1; z < cChunkDef::Width; z++) + { + int zz = z + a_ChunkDesc.GetChunkZ(); + //if (true) + if (m_Noise.CubicNoise2D((float) xx + m_Noise.CubicNoise1D(xx), zz + m_Noise.CubicNoise1D(zz)) < GetBiomeDensity(a_ChunkDesc.GetBiome(x, z))) + { + for (int y = a_ChunkDesc.GetHeight(x, z) + 1; y >= 1; y--) + { + if ( + (a_ChunkDesc.GetBlockType(x, y, z) == E_BLOCK_AIR) && + (a_ChunkDesc.GetBlockType(x, y - 1, z) == E_BLOCK_GRASS) + ) + { + a_ChunkDesc.SetBlockTypeMeta(x, y, z, E_BLOCK_TALL_GRASS, m_Noise.CubicNoise2D(xx * 100, zz * 100) > -0.2 ? 1 : 2); + } + } + } + } + } +} + + + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // cFinishGenSprinkleFoliage: bool cFinishGenSprinkleFoliage::TryAddSugarcane(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ) |