summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorp-mcgowan <mickeymcgowan@shaw.ca>2014-12-01 20:44:20 +0100
committerp-mcgowan <mickeymcgowan@shaw.ca>2014-12-01 20:44:20 +0100
commitcb584a87bd8336d590941cec0c204cbf75ab53eb (patch)
tree507e8fe1afe6c584355f7d0921d1555bec3f986c /src
parentMerge pull request #1636 from mc-server/MineshaftSpawners (diff)
downloadcuberite-cb584a87bd8336d590941cec0c204cbf75ab53eb.tar
cuberite-cb584a87bd8336d590941cec0c204cbf75ab53eb.tar.gz
cuberite-cb584a87bd8336d590941cec0c204cbf75ab53eb.tar.bz2
cuberite-cb584a87bd8336d590941cec0c204cbf75ab53eb.tar.lz
cuberite-cb584a87bd8336d590941cec0c204cbf75ab53eb.tar.xz
cuberite-cb584a87bd8336d590941cec0c204cbf75ab53eb.tar.zst
cuberite-cb584a87bd8336d590941cec0c204cbf75ab53eb.zip
Diffstat (limited to 'src')
-rw-r--r--src/Generating/FinishGen.cpp14
-rw-r--r--src/Generating/FinishGen.h3
2 files changed, 16 insertions, 1 deletions
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index b9d702429..e09646758 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,17 @@ 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 d45365683..16128efa5 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);
+ // Checks if biome is a desert to spawn cacti as opposed to just sand
+ bool IsDesertVariant(EMCSBiome a_biome);
+
// cFinishGen override:
virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
} ;