diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-05-27 19:30:52 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-05-27 19:30:52 +0200 |
commit | 1338caba885cc82c61377053764f63654714f8e0 (patch) | |
tree | cb273e1d226b8ebf3fe37e5e4ff61394dd640b0d /source/FinishGen.cpp | |
parent | Added some useful biome synonyms; added block property IsSnowable; alphabetically sorted block property setting (diff) | |
download | cuberite-1338caba885cc82c61377053764f63654714f8e0.tar cuberite-1338caba885cc82c61377053764f63654714f8e0.tar.gz cuberite-1338caba885cc82c61377053764f63654714f8e0.tar.bz2 cuberite-1338caba885cc82c61377053764f63654714f8e0.tar.lz cuberite-1338caba885cc82c61377053764f63654714f8e0.tar.xz cuberite-1338caba885cc82c61377053764f63654714f8e0.tar.zst cuberite-1338caba885cc82c61377053764f63654714f8e0.zip |
Diffstat (limited to 'source/FinishGen.cpp')
-rw-r--r-- | source/FinishGen.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/source/FinishGen.cpp b/source/FinishGen.cpp index b2f4eab78..8f6f747b2 100644 --- a/source/FinishGen.cpp +++ b/source/FinishGen.cpp @@ -126,7 +126,31 @@ void cFinishGenSnow::GenFinish( cBlockEntityList & a_BlockEntities // Block entities may be added or deleted
)
{
- // TODO: Add snow block in snowy biomes onto blocks that can be snowed over
+ // Add a snow block in snowy biomes onto blocks that can be snowed over
+ for (int z = 0; z < cChunkDef::Width; z++)
+ {
+ for (int x = 0; x < cChunkDef::Width; x++)
+ {
+ switch (cChunkDef::GetBiome(a_BiomeMap, x, z))
+ {
+ case biIcePlains:
+ case biIceMountains:
+ case biTaiga:
+ case biTaigaHills:
+ case biFrozenRiver:
+ case biFrozenOcean:
+ {
+ int Height = cChunkDef::GetHeight(a_HeightMap, x, z);
+ if (g_BlockIsSnowable[cChunkDef::GetBlock(a_BlockTypes, x, Height, z)])
+ {
+ cChunkDef::SetBlock(a_BlockTypes, x, Height + 1, z, E_BLOCK_SNOW);
+ cChunkDef::SetHeight(a_HeightMap, x, z, Height + 1);
+ }
+ break;
+ }
+ }
+ }
+ } // for z
}
|