From 2d0824dd2e6ab6cb77ed512dc42d1fce41bab12a Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Tue, 14 Jun 2022 21:50:59 -0400 Subject: [PATCH] Don't teleport to a safe location for afk freeze when flying --- .../com/earth2me/essentials/EssentialsPlayerListener.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java index 1a1de2a73e0..22acba962be 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java @@ -217,6 +217,10 @@ public void onPlayerMove(final PlayerMoveEvent event) { to.setY(from.getY()); to.setZ(from.getZ()); try { + if (event.getPlayer().getAllowFlight()) { + // Don't teleport to a safe location here, they are either a god or flying + throw new Exception(); + } event.setTo(LocationUtil.getSafeDestination(ess, to)); } catch (final Exception ex) { event.setTo(to);