mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-27 05:40:01 +00:00
Set immobile flag on player pre-spawn
The client likes to fall involuntarily as soon as PLAYER_SPAWN PlayStatus is sent, which causes debug spam on the PM side and then movement reversions if falling far enough. This now prevents the client moving until the server knows the client has spawned.
This commit is contained in:
parent
acb794e728
commit
c96203b528
@ -76,6 +76,8 @@ class PreSpawnSessionHandler extends SessionHandler{
|
||||
$pk->worldName = $this->server->getMotd();
|
||||
$this->session->sendDataPacket($pk);
|
||||
|
||||
$this->player->setImmobile(); //HACK: fix client-side falling pre-spawn
|
||||
|
||||
$this->player->getLevel()->sendTime($this->player);
|
||||
|
||||
$this->player->sendAttributes(true);
|
||||
@ -99,6 +101,8 @@ 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();
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user