summaryrefslogtreecommitdiffstats
path: root/source/cWorld.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-23 22:12:48 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-23 22:12:48 +0100
commitbe31652c40af10b0410c76c6bd37b60717c385be (patch)
treea84e138bc4d0c1cd4b298dc807f3a196e9a78e3d /source/cWorld.cpp
parentFixed a deadlock by removing clients from all chunks upon their exit, not using the clients chunklists. (diff)
downloadcuberite-be31652c40af10b0410c76c6bd37b60717c385be.tar
cuberite-be31652c40af10b0410c76c6bd37b60717c385be.tar.gz
cuberite-be31652c40af10b0410c76c6bd37b60717c385be.tar.bz2
cuberite-be31652c40af10b0410c76c6bd37b60717c385be.tar.lz
cuberite-be31652c40af10b0410c76c6bd37b60717c385be.tar.xz
cuberite-be31652c40af10b0410c76c6bd37b60717c385be.tar.zst
cuberite-be31652c40af10b0410c76c6bd37b60717c385be.zip
Diffstat (limited to '')
-rw-r--r--source/cWorld.cpp98
1 files changed, 98 insertions, 0 deletions
diff --git a/source/cWorld.cpp b/source/cWorld.cpp
index 266d425e4..588640c03 100644
--- a/source/cWorld.cpp
+++ b/source/cWorld.cpp
@@ -1502,3 +1502,101 @@ int cWorld::GetNumChunks(void) const
+
+bool cWorld::WSIIsChunkValid(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
+{
+ return m_ChunkMap->IsChunkValid(a_ChunkX, a_ChunkY, a_ChunkZ);
+}
+
+
+
+
+
+void cWorld::WSIMarkChunkSaving(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
+{
+ m_ChunkMap->MarkChunkSaving(a_ChunkX, a_ChunkY, a_ChunkZ);
+}
+
+
+
+
+
+void cWorld::WSIMarkChunkSaved(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
+{
+ m_ChunkMap->MarkChunkSaved(a_ChunkX, a_ChunkY, a_ChunkZ);
+}
+
+
+
+
+
+void cWorld::WSIChunkLoadFailed(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
+{
+ ChunkLoadFailed(a_ChunkX, a_ChunkY, a_ChunkZ);
+}
+
+
+
+
+
+void cWorld::WSIGenerateChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
+{
+ m_Generator.GenerateChunk(a_ChunkX, a_ChunkY, a_ChunkZ);
+}
+
+
+
+
+
+bool cWorld::WSIGetChunkData(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cChunkDataCallback & a_Callback)
+{
+ return m_ChunkMap->GetChunkData(a_ChunkX, a_ChunkY, a_ChunkZ, a_Callback);
+}
+
+
+
+
+
+AString cWorld::WSIGetFolder(void)
+{
+ return m_WorldName;
+}
+
+
+
+
+
+void cWorld::WSIChunkDataLoaded(
+ int a_ChunkX, int a_ChunkY, int a_ChunkZ,
+ const BLOCKTYPE * a_BlockTypes,
+ const BLOCKTYPE * a_BlockMeta,
+ const BLOCKTYPE * a_BlockLight,
+ const BLOCKTYPE * a_BlockSkyLight,
+ const cChunkDef::HeightMap * a_HeightMap,
+ cEntityList & a_Entities,
+ cBlockEntityList & a_BlockEntities
+)
+{
+ // Set all a_Entities' and a_BlockEntities' world to this:
+ for (cEntityList::iterator itr = a_Entities.begin(); itr != a_Entities.end(); ++itr)
+ {
+ (*itr)->SetWorld(this);
+ } // for itr - a_Entities[]
+ for (cBlockEntityList::iterator itr = a_BlockEntities.begin(); itr != a_BlockEntities.end(); ++itr)
+ {
+ (*itr)->SetWorld(this);
+ } // for itr - a_BlockEntities[]
+
+ m_ChunkMap->ChunkDataLoaded(
+ a_ChunkX, a_ChunkY, a_ChunkZ,
+ a_BlockTypes, a_BlockMeta, a_BlockLight, a_BlockSkyLight,
+ a_HeightMap,
+ a_Entities,
+ a_BlockEntities
+ );
+ m_ChunkSender.ChunkReady(a_ChunkX, a_ChunkY, a_ChunkZ);
+}
+
+
+
+