mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Reimplementing skill level and power level caps.
This commit is contained in:
parent
d367dbf767
commit
11b5c54c69
@ -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