Added API to get level caps

Use getLevelCap(String skillType) to get a level cap of a specific
skill.
Use getPowerLevelCap() to get the power level cap.
This commit is contained in:
TfT_02 2013-03-04 15:16:33 +01:00
parent 2f83e559a4
commit 27ed5f7c38
2 changed files with 24 additions and 0 deletions

View File

@ -8,6 +8,7 @@ Key:
- Removal
Version 1.4.02-dev
+ Added API to get the skill and power level caps.
Version 1.4.01
= Fixed bug where trying to use /mctop or /xplock with the Smelting child skill caused NPEs

View File

@ -237,6 +237,29 @@ public final class ExperienceAPI {
return UserManager.getPlayer(player).getPowerLevel();
}
/**
* Get the level cap of a specific skill.
* </br>
* This function is designed for API usage.
*
* @param skillType The skill to get the level cap for
* @return the level cap of a given skill
*/
public static int getLevelCap(String skillType) {
return Config.getInstance().getLevelCap(SkillType.getSkill(skillType));
}
/**
* Get the power level cap.
* </br>
* This function is designed for API usage.
*
* @return the power level cap of a given skill
*/
public static int getPowerLevelCap() {
return Config.getInstance().getPowerLevelCap();
}
/**
* Sets the level of a player in a specific skill type.
* </br>