Additionally, checking if player is active and afk protection is enabled before setting player as afk.
This commit is contained in:
@ -13,7 +13,8 @@ public class OnPlayerTickEventHandler {
|
||||
if (protectedPlayer == null) {
|
||||
return;
|
||||
}
|
||||
if (event.player.tickCount - protectedPlayer.getLastInputTick() >= Config.Server.AFK_TIME_THRESHOLD.get() * 20) {
|
||||
if (protectedPlayer.getState().equals(ProtectedPlayer.State.ACTIVE) && Config.Server.AFK_PROTECTION_ENABLED.get() &&
|
||||
event.player.tickCount - protectedPlayer.getLastInputTick() >= Config.Server.AFK_TIME_THRESHOLD.get() * 20) {
|
||||
ProtectedPlayerManager.updateState(protectedPlayer.getPlayerUUID());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user