Skip to content

Commit

Permalink
Don't teleport to a safe location for AFK freeze when flying (#4944)
Browse files Browse the repository at this point in the history
Fixes #4902.
  • Loading branch information
JRoy committed Jun 15, 2022
1 parent 0931b21 commit 96c6c95
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 96c6c95

Please sign in to comment.