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 8cba8da516
commit 543672a2a8
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);