do not rely on GameMode::getMagicNumber() to match protocol IDs

This commit is contained in:
Dylan K. Taylor
2020-06-13 12:26:17 +01:00
parent 5c16261374
commit 465285b3c2
4 changed files with 22 additions and 5 deletions

View File

@@ -684,7 +684,7 @@ class NetworkSession{
}
public function syncGameMode(GameMode $mode, bool $isRollback = false) : void{
$this->sendDataPacket(SetPlayerGameTypePacket::create(TypeConverter::getInstance()->getClientFriendlyGamemode($mode)));
$this->sendDataPacket(SetPlayerGameTypePacket::create(TypeConverter::getInstance()->coreGameModeToProtocol($mode)));
$this->syncAdventureSettings($this->player);
if(!$isRollback){
$this->invManager->syncCreative();