summaryrefslogtreecommitdiffstats
path: root/src/Generating/CompoGen.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-11 13:03:51 +0100
committermadmaxoft <github@xoft.cz>2014-01-11 13:03:51 +0100
commit37025fca778896d4dee35a8e580d0160e0b3e0db (patch)
tree73c7f42860391666c2bc8eb7fe9aa5117ddd9c3a /src/Generating/CompoGen.cpp
parentFixed cIniFile's SetValue(). (diff)
parentFixed generator adding values to ini file. (diff)
downloadcuberite-37025fca778896d4dee35a8e580d0160e0b3e0db.tar
cuberite-37025fca778896d4dee35a8e580d0160e0b3e0db.tar.gz
cuberite-37025fca778896d4dee35a8e580d0160e0b3e0db.tar.bz2
cuberite-37025fca778896d4dee35a8e580d0160e0b3e0db.tar.lz
cuberite-37025fca778896d4dee35a8e580d0160e0b3e0db.tar.xz
cuberite-37025fca778896d4dee35a8e580d0160e0b3e0db.tar.zst
cuberite-37025fca778896d4dee35a8e580d0160e0b3e0db.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/CompoGen.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Generating/CompoGen.cpp b/src/Generating/CompoGen.cpp
index f929ddc2f..60356fe46 100644
--- a/src/Generating/CompoGen.cpp
+++ b/src/Generating/CompoGen.cpp
@@ -589,7 +589,22 @@ void cCompoGenNether::ComposeTerrain(cChunkDesc & a_ChunkDesc)
for (int y = 0; y < SEGMENT_HEIGHT; y++)
{
int Val = Lo + (Hi - Lo) * y / SEGMENT_HEIGHT;
- a_ChunkDesc.SetBlockType(x, y + Segment, z, (Val < m_Threshold) ? E_BLOCK_NETHERRACK : E_BLOCK_AIR);
+ BLOCKTYPE Block = E_BLOCK_AIR;
+ if (Val < m_Threshold) // Don't calculate if the block should be Netherrack or Soulsand when it's already decided that it's air.
+ {
+ NOISE_DATATYPE NoiseX = ((NOISE_DATATYPE)(BaseX + x)) / 8;
+ NOISE_DATATYPE NoiseY = ((NOISE_DATATYPE)(BaseZ + z)) / 8;
+ NOISE_DATATYPE CompBlock = m_Noise1.CubicNoise3D(NoiseX, (float) (y + Segment) / 2, NoiseY);
+ if (CompBlock < -0.5)
+ {
+ Block = E_BLOCK_SOULSAND;
+ }
+ else
+ {
+ Block = E_BLOCK_NETHERRACK;
+ }
+ }
+ a_ChunkDesc.SetBlockType(x, y + Segment, z, Block);
}
}