summaryrefslogtreecommitdiffstats
path: root/src/World.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-02-13 17:04:25 +0100
committermadmaxoft <github@xoft.cz>2014-02-13 17:04:25 +0100
commit9bb48a8fa4368d9cc5d9050a6a67f38891afc14e (patch)
treefcf8e28d0843c8a61990a146ff9643702a5ecc24 /src/World.h
parentMCADefrag: Implemented recompression. (diff)
parentFixed formatting issue in APIDesc.lua (diff)
downloadcuberite-9bb48a8fa4368d9cc5d9050a6a67f38891afc14e.tar
cuberite-9bb48a8fa4368d9cc5d9050a6a67f38891afc14e.tar.gz
cuberite-9bb48a8fa4368d9cc5d9050a6a67f38891afc14e.tar.bz2
cuberite-9bb48a8fa4368d9cc5d9050a6a67f38891afc14e.tar.lz
cuberite-9bb48a8fa4368d9cc5d9050a6a67f38891afc14e.tar.xz
cuberite-9bb48a8fa4368d9cc5d9050a6a67f38891afc14e.tar.zst
cuberite-9bb48a8fa4368d9cc5d9050a6a67f38891afc14e.zip
Diffstat (limited to '')
-rw-r--r--src/World.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/World.h b/src/World.h
index fa83fe73e..de4fa6ea6 100644
--- a/src/World.h
+++ b/src/World.h
@@ -99,6 +99,15 @@ public:
} ;
+ class cTaskUnloadUnusedChunks :
+ public cTask
+ {
+ protected:
+ // cTask overrides:
+ virtual void Run(cWorld & a_World) override;
+ };
+
+
static const char * GetClassStatic(void) // Needed for ManualBindings's ForEach templates
{
return "cWorld";
@@ -243,7 +252,8 @@ public:
bool IsChunkValid (int a_ChunkX, int a_ChunkZ) const;
bool HasChunkAnyClients(int a_ChunkX, int a_ChunkZ) const;
- void UnloadUnusedChunks(void); // tolua_export
+ /** Queues a task to unload unused chunks onto the tick thread. The prefferred way of unloading*/
+ void QueueUnloadUnusedChunks(void); // tolua_export
void CollectPickupsByPlayer(cPlayer * a_Player);
@@ -866,6 +876,9 @@ private:
/** Ticks all clients that are in this world */
void TickClients(float a_Dt);
+ /** Unloads all chunks immediately.*/
+ void UnloadUnusedChunks(void);
+
void UpdateSkyDarkness(void);
/** <summary>Generates a random spawnpoint on solid land by walking chunks and finding their biomes</summary> */