1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-16 03:24:31 +02:00

Reset fall distance when toggling fly so fall damage is not accidentally applied.

This commit is contained in:
KHobbits
2013-08-18 22:43:43 +01:00
parent a6bb2cf9a0
commit f0a8798b55
2 changed files with 3 additions and 1 deletions

View File

@@ -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);

View File

@@ -52,8 +52,9 @@ public class Commandfly extends EssentialsToggleCommand
enabled = !user.getAllowFlight();
}
user.setFallDistance(0f);
user.setAllowFlight(enabled);
if (!user.getAllowFlight())
{
user.setFlying(false);