mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
Level: Fixed 2D block cache not getting counted correctly
Fixes #1903 Closes #1906, which, while a pretty solution, is very inefficient (see PR discussion). This is an optimization of microscopic proportions, but the point still stands.
This commit is contained in:
parent
98b36fd73e
commit
fe4b5498e6
@ -932,8 +932,13 @@ class Level implements ChunkManager, Metadatable{
|
||||
$this->chunkCache = [];
|
||||
$this->blockCache = [];
|
||||
}else{
|
||||
if(count($this->blockCache) > 2048){
|
||||
$this->blockCache = [];
|
||||
$count = 0;
|
||||
foreach($this->blockCache as $list){
|
||||
$count += count($list);
|
||||
if($count > 2048){
|
||||
$this->blockCache = [];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user