Added far-generated loaded chunk to garbage collection

This commit is contained in:
Shoghi Cervantes
2014-07-14 12:46:03 +02:00
parent 0db009b08f
commit 79e864f4f1
6 changed files with 20 additions and 4 deletions

View File

@ -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);