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:
Dylan K. Taylor
2018-07-18 16:48:53 +01:00
parent e57dd3e8ba
commit 1144620f2b
3 changed files with 19 additions and 20 deletions

View File

@@ -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();