mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09:44 +00:00
Merge branch 'release/3.4'
This commit is contained in:
commit
8b9ec5dde3
@ -3015,6 +3015,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$this->unloadChunkRequest($X, $Z, true);
|
$this->unloadChunkRequest($X, $Z, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$chunk->collectGarbage();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->provider->doGarbageCollection();
|
$this->provider->doGarbageCollection();
|
||||||
|
@ -767,18 +767,13 @@ class Chunk{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disposes of empty subchunks
|
* Disposes of empty subchunks and frees data where possible
|
||||||
*/
|
*/
|
||||||
public function pruneEmptySubChunks(){
|
public function collectGarbage() : void{
|
||||||
foreach($this->subChunks as $y => $subChunk){
|
foreach($this->subChunks as $y => $subChunk){
|
||||||
if($subChunk instanceof EmptySubChunk){
|
if(!($subChunk instanceof EmptySubChunk) and $subChunk->isEmpty()){ //normal subchunk full of air, remove it and replace it with an empty stub
|
||||||
continue;
|
|
||||||
}elseif($subChunk->isEmpty()){ //normal subchunk full of air, remove it and replace it with an empty stub
|
|
||||||
$this->subChunks[$y] = $this->emptySubChunk;
|
$this->subChunks[$y] = $this->emptySubChunk;
|
||||||
}else{
|
|
||||||
continue; //do not set changed
|
|
||||||
}
|
}
|
||||||
$this->hasChanged = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user