diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index f623927fa..559090fa0 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1001,8 +1001,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, } public function doFirstSpawn(){ - $this->networkSession->onSpawn(); - if($this->hasPermission(Server::BROADCAST_CHANNEL_USERS)){ PermissionManager::getInstance()->subscribeToPermission(Server::BROADCAST_CHANNEL_USERS, $this); } diff --git a/src/pocketmine/network/mcpe/NetworkSession.php b/src/pocketmine/network/mcpe/NetworkSession.php index 943b8584a..49601d88a 100644 --- a/src/pocketmine/network/mcpe/NetworkSession.php +++ b/src/pocketmine/network/mcpe/NetworkSession.php @@ -567,6 +567,7 @@ class NetworkSession{ } public function onSpawn() : void{ + $this->player->doFirstSpawn(); $this->setHandler(new InGameSessionHandler($this->player, $this)); } diff --git a/src/pocketmine/network/mcpe/handler/PreSpawnSessionHandler.php b/src/pocketmine/network/mcpe/handler/PreSpawnSessionHandler.php index 81a67f3df..ef8fd1f33 100644 --- a/src/pocketmine/network/mcpe/handler/PreSpawnSessionHandler.php +++ b/src/pocketmine/network/mcpe/handler/PreSpawnSessionHandler.php @@ -108,7 +108,7 @@ class PreSpawnSessionHandler extends SessionHandler{ public function handleSetLocalPlayerAsInitialized(SetLocalPlayerAsInitializedPacket $packet) : bool{ $this->player->setImmobile(false); //HACK: this is set to prevent client-side falling before spawn - $this->player->doFirstSpawn(); + $this->session->onSpawn(); return true; }