me.armar.plugins.autorank.api
Class API

java.lang.Object
  extended by me.armar.plugins.autorank.api.API

public class API
extends java.lang.Object

Autorank's API class:

You, as a developer, can you use this class to get data from players or data about groups. The API is never finished and if you want to see something added, tell us!

Author:
Staartvin

Field Summary
private  Autorank plugin
           
 
Constructor Summary
API(Autorank instance)
           
 
Method Summary
 java.util.List<Requirement> getAllRequirements(org.bukkit.entity.Player player)
          Gets all requirements for a player at the exact moment.
 java.util.List<Requirement> getFailedRequirements(org.bukkit.entity.Player player)
          Gets all requirements that are not yet completed.
 int getGlobalPlayTime(java.lang.String playerName)
          Gets the global play time (playtime across all servers with the same MySQL database linked) of a player.
 int getLocalPlayTime(java.lang.String playerName)
          Gets the local play time (playtime on this server) of a player.
 java.lang.String getMySQLDatabase()
          Gets the database name Autorank stores its global times in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plugin

private Autorank plugin
Constructor Detail

API

public API(Autorank instance)
Method Detail

getLocalPlayTime

public int getLocalPlayTime(java.lang.String playerName)
Gets the local play time (playtime on this server) of a player.

Parameters:
playerName - player to check for.
Returns:
play time of a player. 0 when has never played before.

getMySQLDatabase

public java.lang.String getMySQLDatabase()
Gets the database name Autorank stores its global times in.

Returns:
name of database

getGlobalPlayTime

public int getGlobalPlayTime(java.lang.String playerName)
Gets the global play time (playtime across all servers with the same MySQL database linked) of a player.

Parameters:
playerName - player to check for.
Returns:
play time of a player. -1 if no entry was found.

getAllRequirements

public java.util.List<Requirement> getAllRequirements(org.bukkit.entity.Player player)
Gets all requirements for a player at the exact moment. This does not consider already finished requirement but just mirrors the config file.

Parameters:
player - Player to get the requirements from.
Returns:
a list of requirement. An empty list when none are found.

getFailedRequirements

public java.util.List<Requirement> getFailedRequirements(org.bukkit.entity.Player player)
Gets all requirements that are not yet completed.

Parameters:
player - Player to get the failed requirements for.
Returns:
list of requirements that still have to be completed.