From df069b041814b1e7317487314eeae5686323812c Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 1 Dec 2024 15:25:05 +0000 Subject: [PATCH] Fixed behavioural BC break in setAllowFlight() --- src/player/Player.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/player/Player.php b/src/player/Player.php index 23150bb04..fea9107d3 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -456,9 +456,6 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ * Note: Setting this to false DOES NOT change whether the player is currently flying. Use * {@link Player::setFlying()} for that purpose. * - * Note: As of 4.13, this will override any game mode flight restrictions for the duration of the game session. - * This differs from previous behaviour, where the flag would get overwritten by game mode changes. - * * @deprecated This is now controlled by setting a permission, which allows more fine-tuned control. * @see DefaultPermissionNames::GAME_FLIGHT */ @@ -1130,6 +1127,9 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ $this->gamemode = $gameMode; $this->setBasePermission($this->gamemode->getPermissionGroupName(), true); + //TODO: this preserves old behaviour of gamemode changes overriding setAllowFlight + //we should get rid of this when setAllowFlight is removed + $this->unsetBasePermission(DefaultPermissionNames::GAME_FLIGHT); $this->hungerManager->setEnabled($this->isSurvival()); if($this->isSpectator()){