From 080b35bf538b5af7e8c4095a762034bd52156967 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 21 Jun 2017 11:54:05 +0100 Subject: [PATCH] Do chunk orders and sending during onUpdate() when we know the player has been constructed --- src/pocketmine/Player.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 7e5e8f46c..4cf150693 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1679,6 +1679,14 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade return true; } + if($this->nextChunkOrderRun-- <= 0 or $this->chunk === null){ + $this->orderChunks(); + } + + if(count($this->loadQueue) > 0 or !$this->spawned){ + $this->sendNextChunk(); + } + $this->timings->startTiming(); if($this->spawned){ @@ -1742,14 +1750,6 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade 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 = [];