Player: move some respawn net sync logic to NetworkSession

This commit is contained in:
Dylan K. Taylor 2019-06-17 16:27:04 +01:00
parent 3c677bd3ec
commit 92e81e3298
2 changed files with 5 additions and 6 deletions

View File

@ -2530,12 +2530,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
$attr->resetToDefault(); $attr->resetToDefault();
} }
$this->sendData($this);
$this->sendData($this->getViewers());
$this->networkSession->syncAdventureSettings($this);
$this->networkSession->syncAllInventoryContents();
$this->spawnToAll(); $this->spawnToAll();
$this->scheduleUpdate(); $this->scheduleUpdate();

View File

@ -586,6 +586,11 @@ class NetworkSession{
} }
public function onRespawn() : void{ 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)); $this->setHandler(new InGameSessionHandler($this->player, $this));
} }