mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Don't need the same function in two places.
This commit is contained in:
parent
5d6a35d4ef
commit
c39827ed59
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user