mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-25 04:37:44 +00:00
If both freeze-afk-players and cancel-afk-on-move is turned on, cancel AFK on player jump.
This commit is contained in:
parent
e666c27d96
commit
12b527be99
|
@ -89,7 +89,12 @@ public class EssentialsPlayerListener implements Listener
|
|||
if (user.isAfk() && ess.getSettings().getFreezeAfkPlayers())
|
||||
{
|
||||
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.setY(from.getY());
|
||||
to.setZ(from.getZ());
|
||||
|
|
Loading…
Reference in a new issue