summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-18 23:13:44 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-18 23:13:44 +0100
commita686656253b9bd11238b2ae2210f809b49c355b9 (patch)
tree112663e0d7be31401232bd6e3f4f10852776639e /src/Chunk.cpp
parentMerge branch 'itemframes' of https://github.com/mc-server/MCServer into itemframes (diff)
parentMerge pull request #696 from mc-server/paintings (diff)
downloadcuberite-a686656253b9bd11238b2ae2210f809b49c355b9.tar
cuberite-a686656253b9bd11238b2ae2210f809b49c355b9.tar.gz
cuberite-a686656253b9bd11238b2ae2210f809b49c355b9.tar.bz2
cuberite-a686656253b9bd11238b2ae2210f809b49c355b9.tar.lz
cuberite-a686656253b9bd11238b2ae2210f809b49c355b9.tar.xz
cuberite-a686656253b9bd11238b2ae2210f809b49c355b9.tar.zst
cuberite-a686656253b9bd11238b2ae2210f809b49c355b9.zip
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r--src/Chunk.cpp32
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();