mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-15 19:46:20 +00:00
Collect unallocated chunks from the Level provider
This commit is contained in:
@@ -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();
|
$this->timings->doChunkGC->stopTiming();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -214,7 +214,7 @@ interface LevelProvider{
|
|||||||
public function setSpawn(Vector3 $pos);
|
public function setSpawn(Vector3 $pos);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Chunk
|
* @return Chunk[]
|
||||||
*/
|
*/
|
||||||
public function getLoadedChunks();
|
public function getLoadedChunks();
|
||||||
|
|
||||||
|
@@ -77,7 +77,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(count($heightMap) === 256){
|
if(count($heightMap) === 256){
|
||||||
$this->heightMap = 256;
|
$this->heightMap = $heightMap;
|
||||||
}else{
|
}else{
|
||||||
$this->heightMap = array_fill(0, 256, 127);
|
$this->heightMap = array_fill(0, 256, 127);
|
||||||
}
|
}
|
||||||
|
@@ -105,7 +105,7 @@ abstract class BaseFullChunk implements FullChunk{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(count($heightMap) === 256){
|
if(count($heightMap) === 256){
|
||||||
$this->heightMap = 256;
|
$this->heightMap = $heightMap;
|
||||||
}else{
|
}else{
|
||||||
$this->heightMap = array_fill(0, 256, 127);
|
$this->heightMap = array_fill(0, 256, 127);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user