diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-08-18 22:43:43 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-08-18 22:43:43 +0100 |
commit | 543672a2a856f447b2c209cc3cc815cda9efa824 (patch) | |
tree | da3e329cfd921cc6cf7e7f365d55a2ff966f131b | |
parent | 8cba8da516ffbc880ed2f4d80de2f43f82e0b44d (diff) | |
download | Essentials-543672a2a856f447b2c209cc3cc815cda9efa824.tar Essentials-543672a2a856f447b2c209cc3cc815cda9efa824.tar.gz Essentials-543672a2a856f447b2c209cc3cc815cda9efa824.tar.lz Essentials-543672a2a856f447b2c209cc3cc815cda9efa824.tar.xz Essentials-543672a2a856f447b2c209cc3cc815cda9efa824.zip |
Reset fall distance when toggling fly so fall damage is not accidentally applied.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 1 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandfly.java | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 6eb3e1134..e5839f104 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -421,6 +421,7 @@ public class EssentialsPlayerListener implements Listener final User user = ess.getUser(event.getPlayer()); if (user.getGameMode() != GameMode.CREATIVE && !user.isAuthorized("essentials.fly")) { + user.setFallDistance(0f); user.setAllowFlight(false); } user.setFlySpeed(0.1f); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java index 43b40a780..8036ba57c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java @@ -52,8 +52,9 @@ public class Commandfly extends EssentialsToggleCommand enabled = !user.getAllowFlight(); } + user.setFallDistance(0f); user.setAllowFlight(enabled); - + if (!user.getAllowFlight()) { user.setFlying(false); |