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); return BleedTimerTask.isBleeding(entity);
} }
public static SecondaryAbility createSecondaryAbility(String name) { public static SecondaryAbility createSecondaryAbility(String name, String skillName) {
return createSecondaryAbility(name, 0, 100); 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); SecondaryAbility ability = new SecondaryAbility(name);
AdvancedConfig.getInstance().createNewSkill(ability, maxBonusLevel, maxChance); AdvancedConfig.getInstance().createNewSkill(ability, skillName, maxBonusLevel, maxChance);
return ability; return ability;
} }
} }

View File

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