Don't teleport to a safe location for AFK freeze when flying (#4944)

Fixes #4902.
This commit is contained in:
Josh Roy 2022-06-15 11:43:57 -04:00 committed by GitHub
parent 0931b21f6d
commit 96c6c951e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,6 +217,10 @@ public class EssentialsPlayerListener implements Listener, FakeAccessor {
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);