mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-11-19 17:52:40 +00: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
1 changed files with 3 additions and 1 deletions
|
@ -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 a new issue