Player: lock flight state in spectator mode

players should not be able to stop flying in spectator mode
This commit is contained in:
Dylan K. Taylor 2022-09-20 21:53:51 +01:00
parent 66e70e5b0e
commit d1c75da14b
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -1021,7 +1021,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
protected function internalSetGameMode(GameMode $gameMode) : void{
$this->gamemode = $gameMode;
$this->allowFlight = $this->isCreative();
$this->allowFlight = $this->gamemode->equals(GameMode::CREATIVE());
$this->hungerManager->setEnabled($this->isSurvival());
if($this->isSpectator()){