/** * Determines if a player can be set to ignored for the sleep check. * * @param player the player to check * @return true if the player can be set to ignored for the sleep check */ public boolean canIgnoreSleep(Player player) { AFKSession session = sessions.getSession(AFKSession.class, player); return (session.isRequested() && canIgnoreSleep(true)) || (isAfk(session.getLastUpdate()) && canIgnoreSleep(false)); }
if (canIgnoreSleep(session.isRequested()) || (passedTime && canIgnoreSleep(false))) { if (!target.isSleepingIgnored()) { target.setSleepingIgnored(true);