clean up gamemode net sync

This commit is contained in:
Dylan K. Taylor
2019-06-10 19:58:14 +01:00
parent f0d56f25b6
commit 8e6f21afad
3 changed files with 8 additions and 18 deletions

View File

@ -610,8 +610,12 @@ class NetworkSession{
$this->sendDataPacket(SetSpawnPositionPacket::playerSpawn($newSpawn->getFloorX(), $newSpawn->getFloorY(), $newSpawn->getFloorZ(), false)); //TODO: spawn forced
}
public function syncGameMode(GameMode $mode) : void{
public function syncGameMode(GameMode $mode, bool $isRollback = false) : void{
$this->sendDataPacket(SetPlayerGameTypePacket::create(self::getClientFriendlyGamemode($mode)));
$this->syncAdventureSettings($this->player);
if(!$isRollback){
$this->syncCreativeInventoryContents();
}
}
/**