Simple Jar File Cleaned only with the API for my plugin UltraAFK.
- Tested Minecraft Versions:
For use this api requires UltraAFK 9.8 D Version.
Requested by @AlonsoAliaga
Call the API:
Check if player is AFKCode (Java):
UltraAFKAPI instance = UltraAFKAPI.getAPI();
Check Player Files/YamlConfigurations, for get plugin data.Code (Java):
boolean isAFK = instance.isPlayerAFK(Player);
Check if server is using UltraAFK as BungeeCord or MultiWorld ServerCode (Java):
File file = instance.getPlayerFile(Player);
YamlConfiguration configuration = instance.getConfigFile(Player);
Getting ServerMode and AFKModeCode (Java):
boolean mode = instance.isBungeeCordServer();
boolean mode = instance.isMultiWorldServer();
Modes serverMode = instance.getServerMode();
AFKModes afkMode = instance.getAFKMode();
// Modes Enum:
MULTIWORLD, AFKZONE, LOBBY
Get the Current time of a Player
Get AFK Detection Delay of a PlayerCode (Java):
// if Player is AFK it will returns the time that the player has as afk.
// if Player is not AFK it will returns the time that plugin has checked the player as "inactive" if player is being detected as "active" it will returns 0
int time = instance.getTimeOfPlayer(Player);
Get AFKZone LocationsCode (Java):
// Returns the time that is setted in config.yml, in this case, the afk detection delay. This includes if mode is PerPermissions or Singular.
int afkTime = getAFKTimeOfPlayer(Player);
//Returns a list of locations, depending if server has more than one location
List<Location> locations = instance.getAFKZoneLocations();