Skip to content

Commit 86621cd

Browse files
authored
Don't enable fly mode on login when player is in water (#6490)
Fixes #6198
1 parent 236ce88 commit 86621cd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,8 @@ private void joinFlow(final User user, final long currentTime, final String mess
513513

514514
if (user.isAuthorized("essentials.fly.safelogin")) {
515515
user.getBase().setFallDistance(0);
516-
if (LocationUtil.shouldFly(ess, user.getLocation())) {
516+
final boolean inWater = VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(VersionUtil.v1_17_R01) && user.getBase().isInWater();
517+
if (!inWater && LocationUtil.shouldFly(ess, user.getLocation())) {
517518
user.getBase().setAllowFlight(true);
518519
user.getBase().setFlying(true);
519520
if (!restoreFly && ess.getSettings().isSendFlyEnableOnJoin()) {

0 commit comments

Comments
 (0)