mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-28 19:11:53 +01:00
Reset fall distance when toggling fly so fall damage is not accidentally applied.
This commit is contained in:
parent
8cba8da516
commit
543672a2a8
@ -421,6 +421,7 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
final User user = ess.getUser(event.getPlayer());
|
final User user = ess.getUser(event.getPlayer());
|
||||||
if (user.getGameMode() != GameMode.CREATIVE && !user.isAuthorized("essentials.fly"))
|
if (user.getGameMode() != GameMode.CREATIVE && !user.isAuthorized("essentials.fly"))
|
||||||
{
|
{
|
||||||
|
user.setFallDistance(0f);
|
||||||
user.setAllowFlight(false);
|
user.setAllowFlight(false);
|
||||||
}
|
}
|
||||||
user.setFlySpeed(0.1f);
|
user.setFlySpeed(0.1f);
|
||||||
|
@ -52,6 +52,7 @@ public class Commandfly extends EssentialsToggleCommand
|
|||||||
enabled = !user.getAllowFlight();
|
enabled = !user.getAllowFlight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
user.setFallDistance(0f);
|
||||||
user.setAllowFlight(enabled);
|
user.setAllowFlight(enabled);
|
||||||
|
|
||||||
if (!user.getAllowFlight())
|
if (!user.getAllowFlight())
|
||||||
|
Loading…
Reference in New Issue
Block a user