diff options
author | Mattes D <github@xoft.cz> | 2014-07-27 15:47:11 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-07-27 15:47:11 +0200 |
commit | d4996a434c163b348f5e701cbf09e5acf34f256b (patch) | |
tree | 73dcce6eb8c93b7390ada216e0c1ec50b0dffbcb /src | |
parent | NetherClumpFoliage: Fixed assert (diff) | |
parent | Removed forgotten comment (diff) | |
download | cuberite-d4996a434c163b348f5e701cbf09e5acf34f256b.tar cuberite-d4996a434c163b348f5e701cbf09e5acf34f256b.tar.gz cuberite-d4996a434c163b348f5e701cbf09e5acf34f256b.tar.bz2 cuberite-d4996a434c163b348f5e701cbf09e5acf34f256b.tar.lz cuberite-d4996a434c163b348f5e701cbf09e5acf34f256b.tar.xz cuberite-d4996a434c163b348f5e701cbf09e5acf34f256b.tar.zst cuberite-d4996a434c163b348f5e701cbf09e5acf34f256b.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/Generating/CompoGen.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Generating/CompoGen.cpp b/src/Generating/CompoGen.cpp index faf2ac243..912d74248 100644 --- a/src/Generating/CompoGen.cpp +++ b/src/Generating/CompoGen.cpp @@ -628,7 +628,22 @@ void cCompoGenNether::ComposeTerrain(cChunkDesc & a_ChunkDesc) for (int z = 0; z < 16; z++) for (int x = 0; x < 16; x++) { a_ChunkDesc.SetBlockType(x, 0, z, E_BLOCK_BEDROCK); - a_ChunkDesc.SetBlockType(x, a_ChunkDesc.GetHeight(x, z), z, E_BLOCK_BEDROCK); + + int Height = a_ChunkDesc.GetHeight(x, z); + a_ChunkDesc.SetBlockType(x, Height, z, E_BLOCK_BEDROCK); + + NOISE_DATATYPE CeilingDisguise = (m_Noise1.CubicNoise2D((float)(a_ChunkDesc.GetChunkX() * cChunkDef::Width + x) / 10, (float)(a_ChunkDesc.GetChunkZ() * cChunkDef::Width + z) / 10)); + if (CeilingDisguise < 0) + { + CeilingDisguise = -CeilingDisguise; + } + + int CeilingDisguiseHeight = Height - 2 - CeilingDisguise * 3; + + for (int y = Height - 1; y > CeilingDisguiseHeight; y--) + { + a_ChunkDesc.SetBlockType(x, y, z, E_BLOCK_NETHERRACK); + } } } |