Fixed flight disabling creative flight

Fixed flight disabling flying when the player is in creative or
spectator mode.
This commit is contained in:
FinnBueno 2016-03-10 20:08:14 +01:00
parent ab4f017c4f
commit 63f6b420dc

View file

@ -3,6 +3,7 @@ package com.projectkorra.projectkorra.airbending;
import com.projectkorra.projectkorra.ability.FlightAbility;
import com.projectkorra.projectkorra.util.Flight;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@ -116,7 +117,7 @@ public class AirFlight extends FlightAbility {
flight.revert();
}
player.setFlying(false);
player.setAllowFlight(false);
player.setAllowFlight(player.getGameMode() == GameMode.CREATIVE || player.getGameMode() == GameMode.SPECTATOR);
}
@Override