Skip to content

Commit

Permalink
Fix toggle flight bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Hai_tun committed Dec 22, 2020
1 parent d69e6b8 commit 8d9b70d
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public void onPlayerToggleFlight(PlayerToggleFlightEvent event) {
return;
else if (inDisabledWorld(player.getLocation())) return;
else if (player.getGameMode() == GameMode.CREATIVE || player.getGameMode() == GameMode.SPECTATOR) return;
else if (!event.isFlying()) return;
else if (player.getWorld().getBlockAt(player.getLocation().subtract(0, 2, 0)).getType() == Material.AIR) {
event.setCancelled(true);
return;
Expand Down

0 comments on commit 8d9b70d

Please sign in to comment.