summaryrefslogtreecommitdiffstats
path: root/src/Generating/FinishGen.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-07-29 17:47:40 +0200
committerMattes D <github@xoft.cz>2014-07-29 17:47:40 +0200
commitd715eb7f5e1e39bbf87bf68a6a677f709e783b13 (patch)
tree5581af7a1f1cb55f2520e7a01ab7339a6b706710 /src/Generating/FinishGen.cpp
parentMerge pull request #1252 from mc-server/RoughRavinesGen (diff)
parentSome finishing touches (diff)
downloadcuberite-d715eb7f5e1e39bbf87bf68a6a677f709e783b13.tar
cuberite-d715eb7f5e1e39bbf87bf68a6a677f709e783b13.tar.gz
cuberite-d715eb7f5e1e39bbf87bf68a6a677f709e783b13.tar.bz2
cuberite-d715eb7f5e1e39bbf87bf68a6a677f709e783b13.tar.lz
cuberite-d715eb7f5e1e39bbf87bf68a6a677f709e783b13.tar.xz
cuberite-d715eb7f5e1e39bbf87bf68a6a677f709e783b13.tar.zst
cuberite-d715eb7f5e1e39bbf87bf68a6a677f709e783b13.zip
Diffstat (limited to 'src/Generating/FinishGen.cpp')
-rw-r--r--src/Generating/FinishGen.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index 9f0c8f3fa..842c9ccc5 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -454,14 +454,14 @@ void cFinishGenIce::GenFinish(cChunkDesc & a_ChunkDesc)
////////////////////////////////////////////////////////////////////////////////
-// cFinishGenLilypads:
+// cFinishGenSingleTopBlock:
-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);
+ }
}