mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-17 08:05:30 +01:00
Ignore flight check on spectator mode.
If a player is in Spectator mode, we should not interfere with their flight. This is an extension to the already existing creative mode check.
This commit is contained in:
parent
dba9dab985
commit
a267fb16b8
@ -408,7 +408,9 @@ public class EssentialsPlayerListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onPlayerChangedWorldFlyReset(final PlayerChangedWorldEvent event) {
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
if (user.getBase().getGameMode() != GameMode.CREATIVE && !user.isAuthorized("essentials.fly")) {
|
||||
if (user.getBase().getGameMode() != GameMode.CREATIVE
|
||||
&& user.getBase().getGameMode() != GameMode.SPECTATOR
|
||||
&& !user.isAuthorized("essentials.fly")) {
|
||||
user.getBase().setFallDistance(0f);
|
||||
user.getBase().setAllowFlight(false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user