mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-11-06 03:50:28 +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
1 changed files with 6 additions and 1 deletions
|
@ -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());
|
||||||
|
|
Loading…
Reference in a new issue