From a0c90d354bb3e3df49c95ea58c318dec17dd7166 Mon Sep 17 00:00:00 2001 From: Rushikumar-06 Date: Sun, 12 Jul 2026 18:58:55 +0530 Subject: [PATCH] reliably restore flight on safelogin to prevent airborne players falling on join --- .../earth2me/essentials/EssentialsPlayerListener.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java index 3b8c2f6e3f4..87253a5c2df 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java @@ -522,6 +522,15 @@ private void joinFlow(final User user, final long currentTime, final String mess if (!inWater && LocationUtil.shouldFly(ess, user.getLocation())) { user.getBase().setAllowFlight(true); user.getBase().setFlying(true); + // The client sends a flight-abilities sync shortly after joining, which resets the flying state + // and drops the player out of the air. Re-apply the flight state a tick later so it sticks and the + // player keeps flying instead of falling (see the equivalent world-change handling below). + ess.scheduleSyncDelayedTask(() -> { + if (user.getBase().isOnline()) { + user.getBase().setAllowFlight(true); + user.getBase().setFlying(true); + } + }, 1); if (!restoreFly && ess.getSettings().isSendFlyEnableOnJoin()) { user.sendTl("flyMode", CommonPlaceholders.enableDisable(user.getSource(), true), user.getDisplayName()); }