public function checkNetwork()
{
if (!$this->isOnline()) {
return;
}
if ($this->nextChunkOrderRun-- <= 0 or $this->chunk === null) {
$this->orderChunks();
}
if (count($this->loadQueue) > 0 or !$this->spawned) {
$this->sendNextChunk();
}
if (count($this->batchedPackets) > 0) {
$this->server->batchPackets([$this], $this->batchedPackets, false);
$this->batchedPackets = [];
}
}