mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-18 00:25:32 +01: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 New Issue
Block a user