summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2014-01-08 22:23:26 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2014-01-08 22:23:26 +0100
commitd46208510870039a4e4870781ca88d0c80a00e32 (patch)
tree605f4d173586bd1b3798269a7e1e8ce2c4f1e5cc
parentWormNestCaves now remove soul sand. (diff)
downloadcuberite-d46208510870039a4e4870781ca88d0c80a00e32.tar
cuberite-d46208510870039a4e4870781ca88d0c80a00e32.tar.gz
cuberite-d46208510870039a4e4870781ca88d0c80a00e32.tar.bz2
cuberite-d46208510870039a4e4870781ca88d0c80a00e32.tar.lz
cuberite-d46208510870039a4e4870781ca88d0c80a00e32.tar.xz
cuberite-d46208510870039a4e4870781ca88d0c80a00e32.tar.zst
cuberite-d46208510870039a4e4870781ca88d0c80a00e32.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/CompoGen.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/Generating/CompoGen.cpp b/src/Generating/CompoGen.cpp
index 9c67170d8..3545863fe 100644
--- a/src/Generating/CompoGen.cpp
+++ b/src/Generating/CompoGen.cpp
@@ -589,17 +589,22 @@ void cCompoGenNether::ComposeTerrain(cChunkDesc & a_ChunkDesc)
for (int y = 0; y < SEGMENT_HEIGHT; y++)
{
int Val = Lo + (Hi - Lo) * y / SEGMENT_HEIGHT;
- NOISE_DATATYPE NoiseX = ((NOISE_DATATYPE)(BaseX * cChunkDef::Width + x)) / 8;
- NOISE_DATATYPE NoiseY = ((NOISE_DATATYPE)(BaseZ * cChunkDef::Width + z)) / 8;
- NOISE_DATATYPE CompBlock = m_Noise1.CubicNoise3D(NoiseX, (float) y, NoiseY);
- if (CompBlock < -0.5)
+ 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.
{
- a_ChunkDesc.SetBlockType(x, y + Segment, z, (Val < m_Threshold) ? E_BLOCK_SOULSAND : E_BLOCK_AIR);
- }
- else
- {
- a_ChunkDesc.SetBlockType(x, y + Segment, z, (Val < m_Threshold) ? E_BLOCK_NETHERRACK : E_BLOCK_AIR);
+ NOISE_DATATYPE NoiseX = ((NOISE_DATATYPE)(BaseX * cChunkDef::Width + x)) / 8;
+ NOISE_DATATYPE NoiseY = ((NOISE_DATATYPE)(BaseZ * cChunkDef::Width + z)) / 8;
+ NOISE_DATATYPE CompBlock = m_Noise1.CubicNoise3D(NoiseX, (float) y, NoiseY);
+ if (CompBlock < -0.5)
+ {
+ Block = E_BLOCK_SOULSAND;
+ }
+ else
+ {
+ Block = E_BLOCK_NETHERRACK;
+ }
}
+ a_ChunkDesc.SetBlockType(x, y + Segment, z, Block);
}
}