Function even MORE things.

This commit is contained in:
gmcferrin 2013-01-09 22:53:26 -05:00
parent 8b9432d1d9
commit c60cbe824c

View File

@ -296,68 +296,55 @@ public class Config extends ConfigLoader {
/* Level Caps */ /* Level Caps */
public int getLevelCapAcrobatics() { public int getLevelCapAcrobatics() {
int cap = config.getInt("Skills.Acrobatics.Level_Cap", 0); return getLevelCap("Skills.Acrobatics.Level_Cap");
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
} }
public int getLevelCapArchery() { public int getLevelCapArchery() {
int cap = config.getInt("Skills.Archery.Level_Cap", 0); return getLevelCap("Skills.Archery.Level_Cap");
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
} }
public int getLevelCapAxes() { public int getLevelCapAxes() {
int cap = config.getInt("Skills.Axes.Level_Cap", 0); return getLevelCap("Skills.Axes.Level_Cap");
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
} }
public int getLevelCapExcavation() { public int getLevelCapExcavation() {
int cap = config.getInt("Skills.Excavation.Level_Cap", 0); return getLevelCap("Skills.Excavation.Level_Cap");
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
} }
public int getLevelCapFishing() { public int getLevelCapFishing() {
int cap = config.getInt("Skills.Fishing.Level_Cap", 0); return getLevelCap("Skills.Fishing.Level_Cap");
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
} }
public int getLevelCapHerbalism() { public int getLevelCapHerbalism() {
int cap = config.getInt("Skills.Herbalism.Level_Cap", 0); return getLevelCap("Skills.Herbalism.Level_Cap");
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
} }
public int getLevelCapMining() { public int getLevelCapMining() {
int cap = config.getInt("Skills.Mining.Level_Cap", 0); return getLevelCap("Skills.Mining.Level_Cap");
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
} }
public int getLevelCapRepair() { public int getLevelCapRepair() {
int cap = config.getInt("Skills.Repair.Level_Cap", 0); return getLevelCap("Skills.Repair.Level_Cap");
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
} }
public int getLevelCapSwords() { public int getLevelCapSwords() {
int cap = config.getInt("Skills.Swords.Level_Cap", 0); return getLevelCap("Skills.Swords.Level_Cap");
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
} }
public int getLevelCapTaming() { public int getLevelCapTaming() {
int cap = config.getInt("Skills.Taming.Level_Cap", 0); return getLevelCap("Skills.Taming.Level_Cap");
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
} }
public int getLevelCapUnarmed() { public int getLevelCapUnarmed() {
int cap = config.getInt("Skills.Unarmed.Level_Cap", 0); return getLevelCap("Skills.Unarmed.Level_Cap");
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
} }
public int getLevelCapWoodcutting() { public int getLevelCapWoodcutting() {
int cap = config.getInt("Skills.Woodcutting.Level_Cap", 0); return getLevelCap("Skills.Woodcutting.Level_Cap");
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
} }
public int getPowerLevelCap() { public int getPowerLevelCap() {
int cap = config.getInt("General.Power_Level_Cap", 0); return getLevelCap("General.Power_Level_Cap");
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
} }
/* PVP & PVE Settings */ /* PVP & PVE Settings */
@ -435,4 +422,9 @@ public class Config extends ConfigLoader {
return disabled; return disabled;
} }
private int getLevelCap(String configString) {
int cap = config.getInt(configString, 0);
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
}
} }