Don't need the same function in two places.

This commit is contained in:
GJ 2013-02-18 10:11:43 -05:00
parent 5d6a35d4ef
commit c39827ed59
3 changed files with 2 additions and 17 deletions

View File

@ -125,7 +125,7 @@ public class McMMOPlayer {
return 0; return 0;
} }
if ((skillType.getMaxLevel() < profile.getSkillLevel(skillType) + 1) || (Misc.getPowerLevelCap() < getPowerLevel() + 1)) { if ((skillType.getMaxLevel() < profile.getSkillLevel(skillType) + 1) || (Config.getInstance().getPowerLevelCap() < getPowerLevel() + 1)) {
return 0; return 0;
} }

View File

@ -239,7 +239,7 @@ public class SkillTools {
if (profile.getSkillXpLevel(skillType) >= profile.getXpToLevel(skillType)) { if (profile.getSkillXpLevel(skillType) >= profile.getXpToLevel(skillType)) {
while (profile.getSkillXpLevel(skillType) >= profile.getXpToLevel(skillType)) { while (profile.getSkillXpLevel(skillType) >= profile.getXpToLevel(skillType)) {
if ((skillType.getMaxLevel() >= profile.getSkillLevel(skillType) + 1) && (Misc.getPowerLevelCap() >= Users.getPlayer(player).getPowerLevel() + 1)) { if ((skillType.getMaxLevel() >= profile.getSkillLevel(skillType) + 1) && (Config.getInstance().getPowerLevelCap() >= Users.getPlayer(player).getPowerLevel() + 1)) {
int xp = profile.getXpToLevel(skillType); int xp = profile.getXpToLevel(skillType);
xpRemoved += xp; xpRemoved += xp;

View File

@ -247,21 +247,6 @@ public final class Misc {
newItem.setItemStack(cloned); newItem.setItemStack(cloned);
} }
/**
* Get the max power level for a player.
*
* @return the maximum power level for a player
*/
public static int getPowerLevelCap() {
int levelCap = Config.getInstance().getPowerLevelCap();
if (levelCap > 0) {
return levelCap;
}
return Integer.MAX_VALUE;
}
public static Random getRandom() { public static Random getRandom() {
return random; return random;
} }