mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Collect unallocated chunks from the Level provider
This commit is contained in:
parent
e4557a2e8e
commit
68da4b5b39
@ -2206,6 +2206,12 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
}
|
||||
|
||||
foreach($this->provider->getLoadedChunks() as $chunk){
|
||||
if(!isset($this->chunks[Level::chunkHash($chunk->getX(), $chunk->getZ())])){
|
||||
$this->provider->unloadChunk($chunk->getX(), $chunk->getZ(), false);
|
||||
}
|
||||
}
|
||||
|
||||
$this->timings->doChunkGC->stopTiming();
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ interface LevelProvider{
|
||||
public function setSpawn(Vector3 $pos);
|
||||
|
||||
/**
|
||||
* @return Chunk
|
||||
* @return Chunk[]
|
||||
*/
|
||||
public function getLoadedChunks();
|
||||
|
||||
|
@ -77,7 +77,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
|
||||
}
|
||||
|
||||
if(count($heightMap) === 256){
|
||||
$this->heightMap = 256;
|
||||
$this->heightMap = $heightMap;
|
||||
}else{
|
||||
$this->heightMap = array_fill(0, 256, 127);
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ abstract class BaseFullChunk implements FullChunk{
|
||||
}
|
||||
|
||||
if(count($heightMap) === 256){
|
||||
$this->heightMap = 256;
|
||||
$this->heightMap = $heightMap;
|
||||
}else{
|
||||
$this->heightMap = array_fill(0, 256, 127);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user