<commit_before>package org.royaldev.royalcommands.runners;

import org.bukkit.entity.Player;
import org.royaldev.royalcommands.AFKUtils;
import org.royaldev.royalcommands.RoyalCommands;

import java.util.Date;

public class AFKWatcher implements Runnable {

    RoyalCommands plugin;

    public AFKWatcher(RoyalCommands instance) {
        plugin = instance;
    }

    @Override
    public void run() {
        long afkKickTime = plugin.afkKickTime;
        long afkAutoTime = plugin.afkAutoTime;
        for (Player p : plugin.getServer().getOnlinePlayers()) {
            long currentTime = new Date().getTime();
            if (!AFKUtils.isAfk(p)) {
                if (!AFKUtils.moveTimesContains(p)) continue;
                if (afkAutoTime <= 0) continue;
                long lastMove = AFKUtils.getLastMove(p);
                if ((lastMove + (afkAutoTime * 1000)) < currentTime) {
                    AFKUtils.setAfk(p, currentTime);
                    plugin.getServer().broadcastMessage(p.getName() + " is now AFK.");
                    continue;
                }
            }
            if (!AFKUtils.isAfk(p)) continue;
            if (afkKickTime <= 0) continue;
            long afkAt = AFKUtils.getAfkTime(p);
            if (plugin.isAuthorized(p, "rcmds.exempt.afkkick")) return;
            if (afkAt + (afkKickTime * 1000) >= currentTime) p.kickPlayer("You have been AFK for too long!");
        }
    }

}
<commit_msg>Fixed: AutoAFK no longer checks vanished players<commit_after>package org.royaldev.royalcommands.runners;

import org.bukkit.entity.Player;
import org.royaldev.royalcommands.AFKUtils;
import org.royaldev.royalcommands.RoyalCommands;

import java.util.Date;

public class AFKWatcher implements Runnable {

    RoyalCommands plugin;

    public AFKWatcher(RoyalCommands instance) {
        plugin = instance;
    }

    @Override
    public void run() {
        long afkKickTime = plugin.afkKickTime;
        long afkAutoTime = plugin.afkAutoTime;
        for (Player p : plugin.getServer().getOnlinePlayers()) {
            long currentTime = new Date().getTime();
            if (!AFKUtils.isAfk(p)) {
                if (plugin.isVanished(p)) continue;
                if (!AFKUtils.moveTimesContains(p)) continue;
                if (afkAutoTime <= 0) continue;
                long lastMove = AFKUtils.getLastMove(p);
                if ((lastMove + (afkAutoTime * 1000)) < currentTime) {
                    AFKUtils.setAfk(p, currentTime);
                    plugin.getServer().broadcastMessage(p.getName() + " is now AFK.");
                    continue;
                }
            }
            if (!AFKUtils.isAfk(p)) continue;
            if (afkKickTime <= 0) continue;
            long afkAt = AFKUtils.getAfkTime(p);
            if (plugin.isAuthorized(p, "rcmds.exempt.afkkick")) return;
            if (afkAt + (afkKickTime * 1000) >= currentTime) p.kickPlayer("You have been AFK for too long!");
        }
    }

}

{'fraction_non_alphanumeric': 0.10902381751090238, 'fraction_numerical': 0.006709158000670915, 'mean_word_length': 2.1555555555555554, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '369133', 'n_tokens_mistral': 946, 'n_tokens_neox': 893, 'n_words': 189}