If both freeze-afk-players and cancel-afk-on-move is turned on, cancel AFK on player jump.

This commit is contained in:
KHobbits 2012-08-28 02:50:59 +01:00
parent e666c27d96
commit 12b527be99

View file

@ -89,7 +89,12 @@ public class EssentialsPlayerListener implements Listener
if (user.isAfk() && ess.getSettings().getFreezeAfkPlayers()) if (user.isAfk() && ess.getSettings().getFreezeAfkPlayers())
{ {
final Location from = event.getFrom(); final Location from = event.getFrom();
final Location to = event.getTo().clone(); final Location origTo = event.getTo();
final Location to = origTo.clone();
if (ess.getSettings().cancelAfkOnMove() && origTo.getY() >= from.getBlockY() + 1) {
user.updateActivity(true);
return;
}
to.setX(from.getX()); to.setX(from.getX());
to.setY(from.getY()); to.setY(from.getY());
to.setZ(from.getZ()); to.setZ(from.getZ());