summaryrefslogtreecommitdiffstats
path: root/src/Generating/FinishGen.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2014-07-28 14:23:29 +0200
committerSTRWarrior <niels.breuker@hotmail.nl>2014-07-28 14:23:29 +0200
commitbf1aa7993202c2f57de88b068d999d262f1874f6 (patch)
treebd6b878c07774c4565706d03f201afae46801fb8 /src/Generating/FinishGen.cpp
parentDistortedHeightmap: Now generates gravel in deep ocean. (diff)
downloadcuberite-bf1aa7993202c2f57de88b068d999d262f1874f6.tar
cuberite-bf1aa7993202c2f57de88b068d999d262f1874f6.tar.gz
cuberite-bf1aa7993202c2f57de88b068d999d262f1874f6.tar.bz2
cuberite-bf1aa7993202c2f57de88b068d999d262f1874f6.tar.lz
cuberite-bf1aa7993202c2f57de88b068d999d262f1874f6.tar.xz
cuberite-bf1aa7993202c2f57de88b068d999d262f1874f6.tar.zst
cuberite-bf1aa7993202c2f57de88b068d999d262f1874f6.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/FinishGen.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index 9f0c8f3fa..4c99c7f86 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -456,12 +456,12 @@ void cFinishGenIce::GenFinish(cChunkDesc & a_ChunkDesc)
////////////////////////////////////////////////////////////////////////////////
// cFinishGenLilypads:
-int cFinishGenSingleBiomeSingleTopBlock::GetNumToGen(const cChunkDef::BiomeMap & a_BiomeMap)
+int cFinishGenSingleTopBlock::GetNumToGen(const cChunkDef::BiomeMap & a_BiomeMap)
{
int res = 0;
for (size_t i = 0; i < ARRAYCOUNT(a_BiomeMap); i++)
{
- if (a_BiomeMap[i] == m_Biome)
+ if (IsAllowedBiome(a_BiomeMap[i]))
{
res++;
}
@@ -473,7 +473,7 @@ int cFinishGenSingleBiomeSingleTopBlock::GetNumToGen(const cChunkDef::BiomeMap &
-void cFinishGenSingleBiomeSingleTopBlock::GenFinish(cChunkDesc & a_ChunkDesc)
+void cFinishGenSingleTopBlock::GenFinish(cChunkDesc & a_ChunkDesc)
{
// Add Lilypads on top of water surface in Swampland
@@ -486,11 +486,13 @@ void cFinishGenSingleBiomeSingleTopBlock::GenFinish(cChunkDesc & a_ChunkDesc)
int z = (m_Noise.IntNoise3DInt(ChunkX - ChunkZ, i, ChunkZ) / 11) % cChunkDef::Width;
// Place the block at {x, z} if possible:
- if (a_ChunkDesc.GetBiome(x, z) != m_Biome)
+ EMCSBiome Biome = a_ChunkDesc.GetBiome(x, z);
+ if (!IsAllowedBiome(Biome))
{
// Incorrect biome
continue;
}
+
int Height = a_ChunkDesc.GetHeight(x, z);
if (Height >= cChunkDef::Height)
{
@@ -502,13 +504,16 @@ void cFinishGenSingleBiomeSingleTopBlock::GenFinish(cChunkDesc & a_ChunkDesc)
// Not an empty block
continue;
}
+
BLOCKTYPE BlockBelow = a_ChunkDesc.GetBlockType(x, Height, z);
- if ((BlockBelow == m_AllowedBelow1) || (BlockBelow == m_AllowedBelow2))
+ if (!IsAllowedBlockBelow(BlockBelow))
{
- a_ChunkDesc.SetBlockType(x, Height + 1, z, m_BlockType);
- a_ChunkDesc.SetHeight(x, z, Height + 1);
+ continue;
}
- } // for i
+
+ a_ChunkDesc.SetBlockType(x, Height + 1, z, m_BlockType);
+ a_ChunkDesc.SetHeight(x, z, Height + 1);
+ }
}