mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Player: move some respawn net sync logic to NetworkSession
This commit is contained in:
@ -2530,12 +2530,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
||||
$attr->resetToDefault();
|
||||
}
|
||||
|
||||
$this->sendData($this);
|
||||
$this->sendData($this->getViewers());
|
||||
|
||||
$this->networkSession->syncAdventureSettings($this);
|
||||
$this->networkSession->syncAllInventoryContents();
|
||||
|
||||
$this->spawnToAll();
|
||||
$this->scheduleUpdate();
|
||||
|
||||
|
@ -586,6 +586,11 @@ class NetworkSession{
|
||||
}
|
||||
|
||||
public function onRespawn() : void{
|
||||
$this->player->sendData($this->player);
|
||||
$this->player->sendData($this->player->getViewers());
|
||||
|
||||
$this->syncAdventureSettings($this->player);
|
||||
$this->syncAllInventoryContents();
|
||||
$this->setHandler(new InGameSessionHandler($this->player, $this));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user