Class AfkManager

java.lang.Object
de.kiridevs.kiricore.managers.AfkManager

public class AfkManager
extends java.lang.Object
A class with only static methods used to manage the AFK status of players using kiriCore's AFK system
  • Constructor Summary

    Constructors 
    Constructor Description
    AfkManager()  
  • Method Summary

    Modifier and Type Method Description
    static java.util.ArrayList<java.lang.String> getAfkList()
    Getter for the full AFK list
    static boolean isAfk​(java.lang.String playername)
    Allows quick checking of the status of a player using the player's name
    static boolean isAfk​(org.bukkit.entity.Player player)
    Allows quick checking of the status of a player using the player's Player object
    static boolean markAfk​(org.bukkit.entity.Player player)
    Marks a player as AFK
    static boolean markBack​(org.bukkit.entity.Player player)
    Marks a player as back (no longer AFK)
    static boolean toggleAfk​(org.bukkit.entity.Player player)
    Possibility to toggle the status of a Player without knowing it in advance

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • isAfk

      public static boolean isAfk​(java.lang.String playername)
      Allows quick checking of the status of a player using the player's name
      Parameters:
      playername - The name (not display name) of the player to check the status of
      Returns:
      true when the player IS marked as AFK right now false when the player is NOT marked as AFK right now
    • isAfk

      public static boolean isAfk​(org.bukkit.entity.Player player)
      Allows quick checking of the status of a player using the player's Player object
      Parameters:
      player - The Player element of the player to check the status of
      Returns:
      true when the player IS marked as AFK right now false when the player is NOT marked as AFK right now
    • markAfk

      public static boolean markAfk​(org.bukkit.entity.Player player)
      Marks a player as AFK
      Parameters:
      player - The player to mark as AFK
      Returns:
      If the action was completed - true: Action completed false: Nothing changed - player was already AFK
    • markBack

      public static boolean markBack​(org.bukkit.entity.Player player)
      Marks a player as back (no longer AFK)
      Parameters:
      player - The player to mark as back
      Returns:
      If the action was completed - true: Action completed false: Nothing changed - player was not AFK
    • toggleAfk

      public static boolean toggleAfk​(org.bukkit.entity.Player player)
      Possibility to toggle the status of a Player without knowing it in advance
      Parameters:
      player - The player to change the status of
      Returns:
      The new AFK status - false: Player is not AFK, true: Player is AFK
    • getAfkList

      public static java.util.ArrayList<java.lang.String> getAfkList()
      Getter for the full AFK list
      Returns:
      The current afkList including player names (not display names) of all players marked AFK at the moment