mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 05:06:45 +01:00
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:
parent
2f83e559a4
commit
27ed5f7c38
@ -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
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user