summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-12-04 23:08:33 +0100
committerMattes D <github@xoft.cz>2014-12-04 23:08:33 +0100
commit8046022a837319000af913697147e5576bbb8348 (patch)
treea460a2b6d674e64764b6a70c820d7a1d9867e7f8
parentMerge pull request #1645 from jonfabe/SpectatorModeFixes (diff)
parentconflict resolution (diff)
downloadcuberite-8046022a837319000af913697147e5576bbb8348.tar
cuberite-8046022a837319000af913697147e5576bbb8348.tar.gz
cuberite-8046022a837319000af913697147e5576bbb8348.tar.bz2
cuberite-8046022a837319000af913697147e5576bbb8348.tar.lz
cuberite-8046022a837319000af913697147e5576bbb8348.tar.xz
cuberite-8046022a837319000af913697147e5576bbb8348.tar.zst
cuberite-8046022a837319000af913697147e5576bbb8348.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/FinishGen.cpp17
-rw-r--r--src/Generating/FinishGen.h3
2 files changed, 19 insertions, 1 deletions
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index 9e035926e..ec487db53 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -370,7 +370,8 @@ void cFinishGenSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
(a_ChunkDesc.GetBlockType(x + 1, y, z) == E_BLOCK_AIR) &&
(a_ChunkDesc.GetBlockType(x - 1, y, z) == E_BLOCK_AIR) &&
(a_ChunkDesc.GetBlockType(x, y, z + 1) == E_BLOCK_AIR) &&
- (a_ChunkDesc.GetBlockType(x, y, z - 1) == E_BLOCK_AIR)
+ (a_ChunkDesc.GetBlockType(x, y, z - 1) == E_BLOCK_AIR) &&
+ IsDesertVariant(a_ChunkDesc.GetBiome(x, z))
)
{
a_ChunkDesc.SetBlockType(x, ++Top, z, E_BLOCK_CACTUS);
@@ -391,6 +392,20 @@ void cFinishGenSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
+bool cFinishGenSprinkleFoliage::IsDesertVariant(EMCSBiome a_Biome)
+{
+ return
+ (
+ (a_Biome == biDesertHills) ||
+ (a_Biome == biDesert) ||
+ (a_Biome == biDesertM)
+ );
+}
+
+
+
+
+
////////////////////////////////////////////////////////////////////////////////
// cFinishGenSoulsandRims
diff --git a/src/Generating/FinishGen.h b/src/Generating/FinishGen.h
index c1100b51f..f568d18bb 100644
--- a/src/Generating/FinishGen.h
+++ b/src/Generating/FinishGen.h
@@ -149,6 +149,9 @@ protected:
/// Tries to place sugarcane at the coords specified, returns true if successful
bool TryAddSugarcane(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ);
+ // Returns true is the specified biome is a desert or its variant
+ static bool IsDesertVariant(EMCSBiome a_biome);
+
// cFinishGen override:
virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
} ;