me.armar.plugins.autorank.statsapi
Class StatsHandler

java.lang.Object
  extended by me.armar.plugins.autorank.statsapi.StatsHandler

public class StatsHandler
				
extends java.lang.Object


Field Summary
private  java.lang.String[] compatibleVersions
           
private  Autorank plugin
           
private  nl.lolmewn.stats.api.StatsAPI statsAPI
           
 
Constructor Summary
StatsHandler(Autorank instance)
           
 
Method Summary
 boolean areBetaFunctionsEnabled()
           
 boolean compatibleStatsVersion(java.lang.String version)
          Check whether the given version of Stats is compatible with Autorank
 int getBlocksStat(java.lang.String playerName, int id, int damageValue, org.bukkit.World world, java.lang.String statType)
          Gets the total blocks of a certain id and damage value placed/broken
 org.bukkit.entity.EntityType getEntityType(java.lang.String entityName)
           
 int getNormalStat(java.lang.String playerName, java.lang.String statName, org.bukkit.World world)
           
 nl.lolmewn.stats.player.StatsPlayer getStats(java.lang.String player)
           
 nl.lolmewn.stats.api.StatsAPI getStatsAPI()
           
 nl.lolmewn.stats.player.StatData getStatType(nl.lolmewn.stats.api.Stat statType, java.lang.String player)
          Get the stats of a player, a new stat will be created if it didn't exist yet.
 int getTotalBlocksBroken(java.lang.String player)
           
 int getTotalBlocksPlaced(java.lang.String player)
           
 int getTotalMobsKilled(java.lang.String playerName, java.lang.String mobName, org.bukkit.World world)
           
 int getTotalPlayTime(java.lang.String playerName, java.lang.String world)
           
 boolean isEnabled()
           
 boolean setupStatsAPI()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plugin

private Autorank plugin
	

statsAPI

private nl.lolmewn.stats.api.StatsAPI statsAPI
	

compatibleVersions

private java.lang.String[] compatibleVersions
	
Constructor Detail

StatsHandler

public StatsHandler(Autorank instance)
Method Detail

setupStatsAPI

public boolean setupStatsAPI()

compatibleStatsVersion

public boolean compatibleStatsVersion(java.lang.String version)
Check whether the given version of Stats is compatible with Autorank

Parameters:
version - version of Stats that is running on this system.
Returns:
true if compatible; false otherwise

getTotalBlocksBroken

public int getTotalBlocksBroken(java.lang.String player)

getTotalBlocksPlaced

public int getTotalBlocksPlaced(java.lang.String player)

getTotalPlayTime

public int getTotalPlayTime(java.lang.String playerName,
                            java.lang.String world)

getStats

public nl.lolmewn.stats.player.StatsPlayer getStats(java.lang.String player)

getStatType

public nl.lolmewn.stats.player.StatData getStatType(nl.lolmewn.stats.api.Stat statType,
                                                    java.lang.String player)
Get the stats of a player, a new stat will be created if it didn't exist yet.

Parameters:
statType - StatType to get from the player
player - Player to get the stats of.
Returns:
Requested stat of the player

getStatsAPI

public nl.lolmewn.stats.api.StatsAPI getStatsAPI()

isEnabled

public boolean isEnabled()

getNormalStat

public int getNormalStat(java.lang.String playerName,
                         java.lang.String statName,
                         org.bukkit.World world)

getBlocksStat

public int getBlocksStat(java.lang.String playerName,
                         int id,
                         int damageValue,
                         org.bukkit.World world,
                         java.lang.String statType)
Gets the total blocks of a certain id and damage value placed/broken

Parameters:
playerName - Player to check for
id - Item ID to check for
damageValue - Damage value to check for. (negative number to not skip check)
world - World to check in. Null for global.
statType - Either "Block break" or "Block place"
Returns:
amount player placed/broke of a block

getTotalMobsKilled

public int getTotalMobsKilled(java.lang.String playerName,
                              java.lang.String mobName,
                              org.bukkit.World world)

getEntityType

public org.bukkit.entity.EntityType getEntityType(java.lang.String entityName)

areBetaFunctionsEnabled

public boolean areBetaFunctionsEnabled()