mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Reorder chunk unloading to leave chunks in memory for the GC time before removal
This commit is contained in:
parent
6cb55da9c7
commit
589fde27c0
@ -1670,14 +1670,6 @@ class Level implements ChunkManager, Metadatable{
|
||||
public function doChunkGarbageCollection(){
|
||||
$X = null;
|
||||
$Z = null;
|
||||
foreach($this->usedChunks as $i => $c){
|
||||
if(count($c) === 0){
|
||||
Level::getXZ($i, $X, $Z);
|
||||
if(!$this->isSpawnChunk($X, $Z)){
|
||||
$this->unloadChunkRequest($X, $Z, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(count($this->unloadQueue) > 0){
|
||||
foreach($this->unloadQueue as $index => $time){
|
||||
@ -1692,6 +1684,15 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($this->usedChunks as $i => $c){
|
||||
if(count($c) === 0){
|
||||
Level::getXZ($i, $X, $Z);
|
||||
if(!$this->isSpawnChunk($X, $Z)){
|
||||
$this->unloadChunkRequest($X, $Z, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user