mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +00:00
Try to clean chunks on other threads
This commit is contained in:
parent
f79476f530
commit
7ee21f6254
@ -117,6 +117,10 @@ class SimpleChunkManager implements ChunkManager{
|
||||
$this->chunks[Level::chunkHash($chunkX, $chunkZ)] = $chunk;
|
||||
}
|
||||
|
||||
public function cleanChunks(){
|
||||
$this->chunks = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the level seed
|
||||
*
|
||||
|
@ -127,13 +127,14 @@ class PopulationTask extends AsyncTask{
|
||||
if(!$c->hasChanged()){
|
||||
$chunks[$i] = null;
|
||||
}
|
||||
$manager->setChunk($c->getX(), $c->getZ(), null);
|
||||
}else{
|
||||
//This way non-changed chunks are not set
|
||||
$chunks[$i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
$manager->cleanChunks();
|
||||
|
||||
$this->chunk00 = $chunks[0] !== null ? $chunks[0]->toFastBinary() : null;
|
||||
$this->chunk01 = $chunks[1] !== null ? $chunks[1]->toFastBinary() : null;
|
||||
$this->chunk02 = $chunks[2] !== null ? $chunks[2]->toFastBinary() : null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user