Merge remote-tracking branch 'origin/release/3.4'

This commit is contained in:
Dylan K. Taylor
2018-11-17 14:47:35 +00:00
2 changed files with 27 additions and 4 deletions

View File

@ -771,8 +771,12 @@ class Chunk{
*/
public function collectGarbage() : void{
foreach($this->subChunks as $y => $subChunk){
if(!($subChunk instanceof EmptySubChunk) and $subChunk->isEmpty()){ //normal subchunk full of air, remove it and replace it with an empty stub
$this->subChunks[$y] = $this->emptySubChunk;
if($subChunk instanceof SubChunk){
if($subChunk->isEmpty()){
$this->subChunks[$y] = $this->emptySubChunk;
}else{
$subChunk->collectGarbage();
}
}
}
}