diff options
author | Mattes D <github@xoft.cz> | 2014-01-11 20:26:09 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-01-11 20:26:09 +0100 |
commit | 5417f7bd2dc4a98ca4cd06070fd08d9ce41c8a9c (patch) | |
tree | 3ebc08f938e5a16c3dd6342f638f6384bc203fe6 /src/World.h | |
parent | Merge pull request #531 from xdot/master (diff) | |
parent | Decoupled cChunkGenerator from cWorld and cRoot. (diff) | |
download | cuberite-5417f7bd2dc4a98ca4cd06070fd08d9ce41c8a9c.tar cuberite-5417f7bd2dc4a98ca4cd06070fd08d9ce41c8a9c.tar.gz cuberite-5417f7bd2dc4a98ca4cd06070fd08d9ce41c8a9c.tar.bz2 cuberite-5417f7bd2dc4a98ca4cd06070fd08d9ce41c8a9c.tar.lz cuberite-5417f7bd2dc4a98ca4cd06070fd08d9ce41c8a9c.tar.xz cuberite-5417f7bd2dc4a98ca4cd06070fd08d9ce41c8a9c.tar.zst cuberite-5417f7bd2dc4a98ca4cd06070fd08d9ce41c8a9c.zip |
Diffstat (limited to 'src/World.h')
-rw-r--r-- | src/World.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/World.h b/src/World.h index f90ddd90f..b61708d03 100644 --- a/src/World.h +++ b/src/World.h @@ -636,6 +636,27 @@ private: virtual void Execute(void) override; } ; + + /** Implementation of the callbacks that the ChunkGenerator uses to store new chunks and interface to plugins */ + class cChunkGeneratorCallbacks : + public cChunkGenerator::cChunkSink, + public cChunkGenerator::cPluginInterface + { + cWorld * m_World; + + // cChunkSink overrides: + virtual void OnChunkGenerated (cChunkDesc & a_ChunkDesc) override; + virtual bool IsChunkValid (int a_ChunkX, int a_ChunkZ) override; + virtual bool HasChunkAnyClients(int a_ChunkX, int a_ChunkZ) override; + + // cPluginInterface overrides: + virtual void CallHookChunkGenerating(cChunkDesc & a_ChunkDesc) override; + virtual void CallHookChunkGenerated (cChunkDesc & a_ChunkDesc) override; + + public: + cChunkGeneratorCallbacks(cWorld & a_World); + } ; + AString m_WorldName; AString m_IniFileName; @@ -714,6 +735,9 @@ private: cChunkGenerator m_Generator; + /** The callbacks that the ChunkGenerator uses to store new chunks and interface to plugins */ + cChunkGeneratorCallbacks m_GeneratorCallbacks; + cChunkSender m_ChunkSender; cLightingThread m_Lighting; cTickThread m_TickThread; |