+ /*
+ True if the chunk and its neighbors are fully generated.
+ It means the chunk will not be touched in the future by the
+ generator. If false, generateChunk will make it true.
+ */
+ bool chunkNonVolatile(v2s16 chunkpos)
+ {
+ if(m_chunksize == 0)
+ return true;
+
+ /*for(s16 x=-1; x<=1; x++)
+ for(s16 y=-1; y<=1; y++)*/
+ s16 x=0;
+ s16 y=0;
+ {
+ v2s16 chunkpos0 = chunkpos + v2s16(x,y);
+ MapChunk *chunk = getChunk(chunkpos);
+ if(chunk == NULL)
+ return false;
+ if(chunk->getGenLevel() != GENERATED_FULLY)
+ return false;
+ }
+ return true;
+ }
+
+ /*
+ Returns true if any chunk is marked as modified
+ */
+ bool anyChunkModified()
+ {
+ for(core::map<v2s16, MapChunk*>::Iterator
+ i = m_chunks.getIterator();
+ i.atEnd()==false; i++)
+ {
+ v2s16 p = i.getNode()->getKey();
+ MapChunk *chunk = i.getNode()->getValue();
+ if(chunk->isModified())
+ return true;
+ }
+ return false;
+ }
+
+ void setChunksNonModified()
+ {
+ for(core::map<v2s16, MapChunk*>::Iterator
+ i = m_chunks.getIterator();
+ i.atEnd()==false; i++)
+ {
+ v2s16 p = i.getNode()->getKey();
+ MapChunk *chunk = i.getNode()->getValue();
+ chunk->setModified(false);
+ }
+ }
+
+ /*
+ Chunks are generated by using these and makeChunk().
+ */
+ void initChunkMake(ChunkMakeData &data, v2s16 chunkpos);
+ MapChunk* finishChunkMake(ChunkMakeData &data,
+ core::map<v3s16, MapBlock*> &changed_blocks);
+