mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56: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
|
- Removal
|
||||||
|
|
||||||
Version 1.4.02-dev
|
Version 1.4.02-dev
|
||||||
|
+ Added API to get the skill and power level caps.
|
||||||
|
|
||||||
Version 1.4.01
|
Version 1.4.01
|
||||||
= Fixed bug where trying to use /mctop or /xplock with the Smelting child skill caused NPEs
|
= 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();
|
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.
|
* Sets the level of a player in a specific skill type.
|
||||||
* </br>
|
* </br>
|
||||||
|
Loading…
Reference in New Issue
Block a user