mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Player: fix the fix which just degraded performance
if a chunk was requested for generation, count++ and count(activeRequests)++, which means that we would only get to submit half as many generation requests as we're allowed to. Calculate the limit at the start and remember it instead.
This commit is contained in:
parent
640e88009b
commit
b8523f7a18
@ -685,8 +685,10 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
|
||||
$count = 0;
|
||||
$world = $this->getWorld();
|
||||
|
||||
$limit = $this->chunksPerTick - count($this->activeChunkGenerationRequests);
|
||||
foreach($this->loadQueue as $index => $distance){
|
||||
if($count >= $this->chunksPerTick - count($this->activeChunkGenerationRequests)){
|
||||
if($count >= $limit){
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user