mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 03:51:37 +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:
@@ -1140,6 +1140,20 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
Timings::$playerChunkOrderTimer->stopTiming();
|
||||
}
|
||||
|
||||
public function doChunkRequests(){
|
||||
if(!$this->isOnline()){
|
||||
return;
|
||||
}
|
||||
|
||||
if($this->nextChunkOrderRun-- <= 0){
|
||||
$this->orderChunks();
|
||||
}
|
||||
|
||||
if(count($this->loadQueue) > 0){
|
||||
$this->sendNextChunk();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Position
|
||||
*/
|
||||
@@ -1774,20 +1788,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
$this->dataPacket($pk);
|
||||
}
|
||||
|
||||
public function checkNetwork(){
|
||||
if(!$this->isOnline()){
|
||||
return;
|
||||
}
|
||||
|
||||
if($this->nextChunkOrderRun-- <= 0){
|
||||
$this->orderChunks();
|
||||
}
|
||||
|
||||
if(count($this->loadQueue) > 0){
|
||||
$this->sendNextChunk();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the player can interact with the specified position. This checks distance and direction.
|
||||
*
|
||||
|
Reference in New Issue
Block a user