cacti no longer spawn outside of desert variants
This commit is contained in:
parent
53a55e62b3
commit
cb584a87bd
@ -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 - 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)
|
(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);
|
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
|
// cFinishGenSoulsandRims
|
||||||
|
|
||||||
|
@ -149,6 +149,9 @@ protected:
|
|||||||
/// Tries to place sugarcane at the coords specified, returns true if successful
|
/// 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);
|
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:
|
// cFinishGen override:
|
||||||
virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
|
virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
|
||||||
} ;
|
} ;
|
||||||
|
Loading…
Reference in New Issue
Block a user