mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +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;
|
$this->chunks[Level::chunkHash($chunkX, $chunkZ)] = $chunk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function cleanChunks(){
|
||||||
|
$this->chunks = [];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the level seed
|
* Gets the level seed
|
||||||
*
|
*
|
||||||
|
@ -127,13 +127,14 @@ class PopulationTask extends AsyncTask{
|
|||||||
if(!$c->hasChanged()){
|
if(!$c->hasChanged()){
|
||||||
$chunks[$i] = null;
|
$chunks[$i] = null;
|
||||||
}
|
}
|
||||||
$manager->setChunk($c->getX(), $c->getZ(), null);
|
|
||||||
}else{
|
}else{
|
||||||
//This way non-changed chunks are not set
|
//This way non-changed chunks are not set
|
||||||
$chunks[$i] = null;
|
$chunks[$i] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$manager->cleanChunks();
|
||||||
|
|
||||||
$this->chunk00 = $chunks[0] !== null ? $chunks[0]->toFastBinary() : null;
|
$this->chunk00 = $chunks[0] !== null ? $chunks[0]->toFastBinary() : null;
|
||||||
$this->chunk01 = $chunks[1] !== null ? $chunks[1]->toFastBinary() : null;
|
$this->chunk01 = $chunks[1] !== null ? $chunks[1]->toFastBinary() : null;
|
||||||
$this->chunk02 = $chunks[2] !== null ? $chunks[2]->toFastBinary() : null;
|
$this->chunk02 = $chunks[2] !== null ? $chunks[2]->toFastBinary() : null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user