mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 23:29:54 +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);
|
$this->server->batchPackets($target, $packets, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function clearCache(bool $full = false){
|
public function clearCache(bool $force = false){
|
||||||
if($full){
|
if($force){
|
||||||
$this->chunkCache = [];
|
$this->chunkCache = [];
|
||||||
$this->blockCache = [];
|
$this->blockCache = [];
|
||||||
}else{
|
}else{
|
||||||
if(count($this->chunkCache) > 768){
|
|
||||||
$this->chunkCache = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
if(count($this->blockCache) > 2048){
|
if(count($this->blockCache) > 2048){
|
||||||
$this->blockCache = [];
|
$this->blockCache = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function clearChunkCache(int $chunkX, int $chunkZ){
|
public function clearChunkCache(int $chunkX, int $chunkZ){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user