mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
De-spaghettify spawn notification handling
This commit is contained in:
@ -567,6 +567,7 @@ class NetworkSession{
|
||||
}
|
||||
|
||||
public function onSpawn() : void{
|
||||
$this->player->doFirstSpawn();
|
||||
$this->setHandler(new InGameSessionHandler($this->player, $this));
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user