Fixed loading of config for secondary abilities

This commit is contained in:
ile123ile 2014-08-31 17:07:53 -07:00
parent ba32e725f8
commit 4d4e3a2b47
2 changed files with 6 additions and 6 deletions

View File

@ -97,13 +97,13 @@ public final class AbilityAPI {
return BleedTimerTask.isBleeding(entity);
}
public static SecondaryAbility createSecondaryAbility(String name) {
return createSecondaryAbility(name, 0, 100);
public static SecondaryAbility createSecondaryAbility(String name, String skillName) {
return createSecondaryAbility(name, skillName, 0, 100);
}
public static SecondaryAbility createSecondaryAbility(String name, int maxBonusLevel, double maxChance) {
public static SecondaryAbility createSecondaryAbility(String name, String skillName, int maxBonusLevel, double maxChance) {
SecondaryAbility ability = new SecondaryAbility(name);
AdvancedConfig.getInstance().createNewSkill(ability, maxBonusLevel, maxChance);
AdvancedConfig.getInstance().createNewSkill(ability, skillName, maxBonusLevel, maxChance);
return ability;
}
}

View File

@ -686,8 +686,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
@Override
protected void loadKeys() {}
public void createNewSkill(SecondaryAbility skillAbility, int maxBonusLevel, double maxChance) {
String skillAbilityString = "Skills." + StringUtils.getCapitalized(SkillType.bySecondaryAbility(skillAbility).toString()) + "." + StringUtils.getPrettySecondaryAbilityString(skillAbility).replace(" ", "");
public void createNewSkill(SecondaryAbility skillAbility, String skillName, int maxBonusLevel, double maxChance) {
String skillAbilityString = "Skills." + StringUtils.getCapitalized(skillName) + "." + StringUtils.getPrettySecondaryAbilityString(skillAbility).replace(" ", "");
config.set(skillAbilityString + ".MaxBonusLevel", maxBonusLevel);
config.set(skillAbilityString + ".ChanceMax", maxChance);
try {