mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Stop clearing chunk cache after 768 batched packets are cached. (#1320)
This commit is contained in:
parent
b9c4a65307
commit
9ea39ea3d7
@ -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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user