summaryrefslogtreecommitdiffstats
path: root/source/cChunkGenerator.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-11 21:25:55 +0200
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-11 21:25:55 +0200
commit373dac3204519b964710fdc693dd16c400881e1a (patch)
tree3faecd747d1da82cffff2ca45890968354dfeb43 /source/cChunkGenerator.cpp
parentFixed a bug in crafting recipes - would consume multiple items of asterisked ingredients (FS #205) (diff)
downloadcuberite-373dac3204519b964710fdc693dd16c400881e1a.tar
cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.gz
cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.bz2
cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.lz
cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.xz
cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.zst
cuberite-373dac3204519b964710fdc693dd16c400881e1a.zip
Diffstat (limited to 'source/cChunkGenerator.cpp')
-rw-r--r--source/cChunkGenerator.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/source/cChunkGenerator.cpp b/source/cChunkGenerator.cpp
index a5bab2b7e..34bbe4b3a 100644
--- a/source/cChunkGenerator.cpp
+++ b/source/cChunkGenerator.cpp
@@ -11,6 +11,7 @@
#include "FinishGen.h"
#include "cRoot.h"
#include "cPluginManager.h"
+#include "cLuaChunk.h"
@@ -483,18 +484,28 @@ void cChunkGenerator::DoGenerate(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
cEntityList Entities;
cBlockEntityList BlockEntities;
- // Use the composed generator:
- m_BiomeGen->GenBiomes(a_ChunkX, a_ChunkZ, BiomeMap);
- m_HeightGen->GenHeightMap(a_ChunkX, a_ChunkZ, HeightMap);
- m_CompositionGen->ComposeTerrain(a_ChunkX, a_ChunkZ, BlockTypes, BlockMeta, HeightMap, BiomeMap, Entities, BlockEntities);
- for (cStructureGenList::iterator itr = m_StructureGens.begin(); itr != m_StructureGens.end(); ++itr)
+
+ cLuaChunk LuaChunk( BlockTypes, BlockMeta, HeightMap, BiomeMap );
+ if( cRoot::Get()->GetPluginManager()->CallHook( cPluginManager::E_PLUGIN_CHUNK_GENERATING, 3, a_ChunkX, a_ChunkZ, &LuaChunk ) )
{
- (*itr)->GenStructures(a_ChunkX, a_ChunkZ, BlockTypes, BlockMeta, HeightMap, Entities, BlockEntities);
- } // for itr - m_StructureGens[]
- for (cFinishGenList::iterator itr = m_FinishGens.begin(); itr != m_FinishGens.end(); ++itr)
+ // A plugin interrupted generation, handle something plugin specific?
+ //LOG("returned true");
+ }
+ else
{
- (*itr)->GenFinish(a_ChunkX, a_ChunkZ, BlockTypes, BlockMeta, HeightMap, BiomeMap, Entities, BlockEntities);
- } // for itr - m_FinishGens[]
+ // Use the composed generator:
+ m_BiomeGen->GenBiomes(a_ChunkX, a_ChunkZ, BiomeMap);
+ m_HeightGen->GenHeightMap(a_ChunkX, a_ChunkZ, HeightMap);
+ m_CompositionGen->ComposeTerrain(a_ChunkX, a_ChunkZ, BlockTypes, BlockMeta, HeightMap, BiomeMap, Entities, BlockEntities);
+ for (cStructureGenList::iterator itr = m_StructureGens.begin(); itr != m_StructureGens.end(); ++itr)
+ {
+ (*itr)->GenStructures(a_ChunkX, a_ChunkZ, BlockTypes, BlockMeta, HeightMap, Entities, BlockEntities);
+ } // for itr - m_StructureGens[]
+ for (cFinishGenList::iterator itr = m_FinishGens.begin(); itr != m_FinishGens.end(); ++itr)
+ {
+ (*itr)->GenFinish(a_ChunkX, a_ChunkZ, BlockTypes, BlockMeta, HeightMap, BiomeMap, Entities, BlockEntities);
+ } // for itr - m_FinishGens[]
+ }
m_World->SetChunkData(
a_ChunkX, a_ChunkY, a_ChunkZ,