API
代码:
public interface AntiAFKPlusAPI { /** * Returns how much checks the Player failed * * @param player the Player to check * @return amount of checks failed */ int getChecksFailed(Player player); /** * Returns the Check Interval configured in the config.yml * * @return the check interval in seconds */ int getCheckInterval(); /** * Returns <tt>true</tt> if the Player failed at least Check * * @param player the Player to check * @return <tt>true</tt> if player failed one AFK check * */ boolean isAFK(Player player); /** * Returns <tt>true</tt> if Player got teleported while AFK * * @param player the Player to check * @return <tt>true</tt> if Player got teleported */ boolean isTeleported(Player player); /** * Returns a {@link List} view of {@link Player} players. * This players failed at least on AFK Check. * * @return a list of players who did not pass one AFK check */ List<Player> getAFKPlayers(); /** * Returns a {@link List} view of {@link Player} players. * This players failed at least the given Amount of Checks. * * @param failedChecks amount of failed Checks * @return a list of players who did not pass the AFK checks */ List<Player> getAFKPlayers(int failedChecks); /** * Create a new API Instance to work with * * @return API Instance */ static AntiAFKPlusAPI getAPI();}