mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Added far-generated loaded chunk to garbage collection
This commit is contained in:
@ -252,7 +252,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
|
||||
public function close(){
|
||||
if($this->autoSave){
|
||||
if($this->getAutoSave()){
|
||||
$this->provider->saveChunks();
|
||||
}
|
||||
$this->provider->close();
|
||||
@ -1721,6 +1721,13 @@ class Level implements ChunkManager, Metadatable{
|
||||
$X = null;
|
||||
$Z = null;
|
||||
|
||||
foreach($this->chunks as $index => $chunk){
|
||||
if(!isset($this->usedChunks[$index])){
|
||||
Level::getXZ($index, $X, $Z);
|
||||
$this->unloadChunkRequest($X, $Z, true);
|
||||
}
|
||||
}
|
||||
|
||||
if(count($this->unloadQueue) > 0){
|
||||
foreach($this->unloadQueue as $index => $time){
|
||||
Level::getXZ($index, $X, $Z);
|
||||
|
Reference in New Issue
Block a user