mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Merge pull request #353 from Glitchfinder/master
Reimplementing Skill Level and Power Level caps.
This commit is contained in:
commit
bd1850db69
@ -345,7 +345,10 @@ public class Config extends ConfigLoader {
|
||||
public int getLevelCapTaming() { return config.getInt("Skills.Taming.Level_Cap", 0); }
|
||||
public int getLevelCapUnarmed() { return config.getInt("Skills.Unarmed.Level_Cap", 0); }
|
||||
public int getLevelCapWoodcutting() { return config.getInt("Skills.Woodcutting.Level_Cap", 0); }
|
||||
public int getPowerLevelCap() { return config.getInt("General.Power_Level_Cap", 0); }
|
||||
public int getPowerLevelCap() {
|
||||
int cap = config.getInt("General.Power_Level_Cap", 0);
|
||||
return ((cap == 0) ? Integer.MAX_VALUE : cap);
|
||||
}
|
||||
|
||||
/* PVP & PVE Settings */
|
||||
public boolean getAcrobaticsPVP() { return config.getBoolean("Skills.Acrobatics.Enabled_For_PVP", true); }
|
||||
|
@ -533,6 +533,9 @@ public class Skills {
|
||||
if(Users.getPlayer(player) == null)
|
||||
return;
|
||||
|
||||
if((type.getMaxLevel() < profile.getSkillLevel(type) + 1) || (Misc.getPowerLevelCap() < Users.getPlayer(player).getPowerLevel() + 1))
|
||||
return;
|
||||
|
||||
Users.getPlayer(player).addXP(type, xp);
|
||||
xpCheckSkill(type, player, profile);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user