diff options
author | madmaxoft <github@xoft.cz> | 2014-01-30 17:41:57 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-01-31 16:01:15 +0100 |
commit | 66427d754b66c91ce76ca23cdbf6bf9c1b377d23 (patch) | |
tree | a57d92cbf51f3df413b7ad8627ed3fd6540a88b1 /src/Generating/ChunkDesc.cpp | |
parent | Fixed some more. (diff) | |
download | cuberite-66427d754b66c91ce76ca23cdbf6bf9c1b377d23.tar cuberite-66427d754b66c91ce76ca23cdbf6bf9c1b377d23.tar.gz cuberite-66427d754b66c91ce76ca23cdbf6bf9c1b377d23.tar.bz2 cuberite-66427d754b66c91ce76ca23cdbf6bf9c1b377d23.tar.lz cuberite-66427d754b66c91ce76ca23cdbf6bf9c1b377d23.tar.xz cuberite-66427d754b66c91ce76ca23cdbf6bf9c1b377d23.tar.zst cuberite-66427d754b66c91ce76ca23cdbf6bf9c1b377d23.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Generating/ChunkDesc.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Generating/ChunkDesc.cpp b/src/Generating/ChunkDesc.cpp index af1a8a6c7..87566aa78 100644 --- a/src/Generating/ChunkDesc.cpp +++ b/src/Generating/ChunkDesc.cpp @@ -562,6 +562,31 @@ cBlockEntity * cChunkDesc::GetBlockEntity(int a_RelX, int a_RelY, int a_RelZ) +void cChunkDesc::UpdateHeightmap(void) +{ + for (int x = 0; x < cChunkDef::Width; x++) + { + for (int z = 0; z < cChunkDef::Width; z++) + { + int Height = 0; + for (int y = cChunkDef::Height - 1; y > 0; y--) + { + BLOCKTYPE BlockType = GetBlockType(x, y, z); + if (BlockType != E_BLOCK_AIR) + { + Height = y; + break; + } + } // for y + SetHeight(x, z, Height); + } // for z + } // for x +} + + + + + void cChunkDesc::CompressBlockMetas(cChunkDef::BlockNibbles & a_DestMetas) { const NIBBLETYPE * AreaMetas = m_BlockArea.GetBlockMetas(); |