me.armar.plugins.autorank
Class AutorankTools

java.lang.Object
  extended by me.armar.plugins.autorank.AutorankTools

public class AutorankTools
extends java.lang.Object


Field Summary
(package private) static java.util.List<java.lang.String> reqTypes
           
 
Constructor Summary
AutorankTools()
           
 
Method Summary
static java.lang.String getCorrectName(java.lang.String oldName)
          This will return the correct type of the requirement.
static boolean isExcluded(org.bukkit.entity.Player player)
          Elaborate method to check whether a player is excluded from ranking.
static java.lang.String minutesToString(int minutes)
           
static void registerRequirement(java.lang.String type)
          Register requirement name so it can be used to get the correct name.
static void sendColoredMessage(org.bukkit.command.CommandSender sender, java.lang.String msg)
           
static double stringtoDouble(java.lang.String string)
           
static int stringtoInt(java.lang.String string)
           
static int stringToMinutes(java.lang.String string)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reqTypes

static java.util.List<java.lang.String> reqTypes
Constructor Detail

AutorankTools

public AutorankTools()
Method Detail

stringToMinutes

public static int stringToMinutes(java.lang.String string)

minutesToString

public static java.lang.String minutesToString(int minutes)

stringtoDouble

public static double stringtoDouble(java.lang.String string)
                             throws java.lang.NumberFormatException
Throws:
java.lang.NumberFormatException

stringtoInt

public static int stringtoInt(java.lang.String string)
                       throws java.lang.NumberFormatException
Throws:
java.lang.NumberFormatException

sendColoredMessage

public static void sendColoredMessage(org.bukkit.command.CommandSender sender,
                                      java.lang.String msg)

isExcluded

public static boolean isExcluded(org.bukkit.entity.Player player)
Elaborate method to check whether a player is excluded from ranking. When a player has a wildcard permission but is an OP, it will return false; When a player has a wildcard permission but is not an OP, it will return true; When a player only has autorank.exclude, it will return true;

Parameters:
player - Player to check for
Returns:
whether a player is excluded from ranking or not.

getCorrectName

public static java.lang.String getCorrectName(java.lang.String oldName)
This will return the correct type of the requirement. As players might want to use multiple requirements of the same type, they only have to specify the name of it with a unique identifier. E.g. time1, time2 or exp1, exp2, etc.

Parameters:
oldName - Name of the requirement to search for.
Returns:
correct requirement name or old name if none was found.

registerRequirement

public static void registerRequirement(java.lang.String type)
Register requirement name so it can be used to get the correct name. If a requirement is not passed through this method, it will not show up in getCorrectName(String).

Parameters:
type - Requirement name