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:
Dylan K. Taylor 2021-11-06 01:00:35 +00:00
parent 640e88009b
commit b8523f7a18
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -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;
}