Stop clearing chunk cache after 768 batched packets are cached. (#1320)

This commit is contained in:
xFlare 2017-08-31 16:14:18 -04:00 committed by Dylan K. Taylor
parent b9c4a65307
commit 9ea39ea3d7

View File

@ -836,21 +836,15 @@ class Level implements ChunkManager, Metadatable{
$this->server->batchPackets($target, $packets, false, false);
}
public function clearCache(bool $full = false){
if($full){
public function clearCache(bool $force = false){
if($force){
$this->chunkCache = [];
$this->blockCache = [];
}else{
if(count($this->chunkCache) > 768){
$this->chunkCache = [];
}
if(count($this->blockCache) > 2048){
$this->blockCache = [];
}
}
}
public function clearChunkCache(int $chunkX, int $chunkZ){