mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +00:00
Level: minor de-spaghettification of chunk requesting
Now the Level tells the player to request chunks on tick, instead of the server doing it.
This commit is contained in:
@@ -787,7 +787,10 @@ class Level implements ChunkManager, Metadatable{
|
||||
|
||||
}
|
||||
|
||||
$this->processChunkRequest();
|
||||
foreach($this->players as $p){
|
||||
$p->doChunkRequests();
|
||||
}
|
||||
$this->processChunkRequests();
|
||||
|
||||
if($this->sleepTicks > 0 and --$this->sleepTicks <= 0){
|
||||
$this->checkSleep();
|
||||
@@ -2464,7 +2467,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
}
|
||||
|
||||
private function processChunkRequest(){
|
||||
private function processChunkRequests(){
|
||||
if(count($this->chunkSendQueue) > 0){
|
||||
$this->timings->syncChunkSendTimer->startTiming();
|
||||
|
||||
|
Reference in New Issue
Block a user