diff options
author | madmaxoft <github@xoft.cz> | 2014-02-18 13:06:18 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-02-18 13:49:23 +0100 |
commit | 803ea412361ee2f4b1d74a811ddbee05f50c9345 (patch) | |
tree | 7d4b18657afb9eb541aeb0e2cd46e8da258251e1 /src/Chunk.cpp | |
parent | Added a bit more documentation to cForEachChunkProvider. (diff) | |
download | cuberite-803ea412361ee2f4b1d74a811ddbee05f50c9345.tar cuberite-803ea412361ee2f4b1d74a811ddbee05f50c9345.tar.gz cuberite-803ea412361ee2f4b1d74a811ddbee05f50c9345.tar.bz2 cuberite-803ea412361ee2f4b1d74a811ddbee05f50c9345.tar.lz cuberite-803ea412361ee2f4b1d74a811ddbee05f50c9345.tar.xz cuberite-803ea412361ee2f4b1d74a811ddbee05f50c9345.tar.zst cuberite-803ea412361ee2f4b1d74a811ddbee05f50c9345.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Chunk.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 3028d24d0..0587beb9c 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -1652,6 +1652,38 @@ void cChunk::UseBlockEntity(cPlayer * a_Player, int a_X, int a_Y, int a_Z) +void cChunk::SetBiomeAt(int a_RelX, int a_RelZ, EMCSBiome a_Biome) +{ + cChunkDef::SetBiome(m_BiomeMap, a_RelX, a_RelZ, a_Biome); + MarkDirty(); +} + + + + + +void cChunk::SetAreaBiome(int a_MinRelX, int a_MaxRelX, int a_MinRelZ, int a_MaxRelZ, EMCSBiome a_Biome) +{ + for (int z = a_MinRelZ; z <= a_MaxRelZ; z++) + { + for (int x = a_MinRelX; x <= a_MaxRelX; x++) + { + cChunkDef::SetBiome(m_BiomeMap, x, z, a_Biome); + } + } + MarkDirty(); + + // Re-send the chunk to all clients: + for (cClientHandleList::iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr) + { + m_World->ForceSendChunkTo(m_PosX, m_PosZ, (*itr)); + } // for itr - m_LoadedByClient[] +} + + + + + void cChunk::CollectPickupsByPlayer(cPlayer * a_Player) { double PosX = a_Player->GetPosX(); |