mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 06:25:32 +00:00
Fixed behavioural BC break in setAllowFlight()
This commit is contained in:
parent
ea43fd1917
commit
df069b0418
@ -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
|
* Note: Setting this to false DOES NOT change whether the player is currently flying. Use
|
||||||
* {@link Player::setFlying()} for that purpose.
|
* {@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.
|
* @deprecated This is now controlled by setting a permission, which allows more fine-tuned control.
|
||||||
* @see DefaultPermissionNames::GAME_FLIGHT
|
* @see DefaultPermissionNames::GAME_FLIGHT
|
||||||
*/
|
*/
|
||||||
@ -1130,6 +1127,9 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
|||||||
$this->gamemode = $gameMode;
|
$this->gamemode = $gameMode;
|
||||||
|
|
||||||
$this->setBasePermission($this->gamemode->getPermissionGroupName(), true);
|
$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());
|
$this->hungerManager->setEnabled($this->isSurvival());
|
||||||
|
|
||||||
if($this->isSpectator()){
|
if($this->isSpectator()){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user