Skip to content

Commit

Permalink
Merge pull request #6 from sqyyy-jar/main
Browse files Browse the repository at this point in the history
Update EventToggleFlight.java
  • Loading branch information
MCTzOCK authored Feb 22, 2021
2 parents e63cd4c + 65a66ce commit e196db9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public class EventToggleFlight implements Listener {
public void onToggleFlight(PlayerToggleFlightEvent e) {
if (e.getPlayer().getGameMode().equals(GameMode.ADVENTURE) || e.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
e.setCancelled(true);
if (e.getPlayer().getFallDistance() <= 0.25) return;
if (e.getPlayer().getLocation().subtract(0, 2, 0).getBlock().getType() != Material.AIR) return;
if (e.getPlayer().getFallDistance() > 0.25) return;
if (e.getPlayer().getLocation().clone().subtract(0, 2, 0).getBlock().getType() == Material.AIR) return;
Location loc = e.getPlayer().getEyeLocation().clone();
loc.setPitch(-30F);
e.getPlayer().setVelocity(loc.getDirection().normalize().multiply(1.5));
Expand Down

0 comments on commit e196db9

Please sign in to comment.