diff --git a/src/main/java/com/gmail/nossr50/api/AbilityAPI.java b/src/main/java/com/gmail/nossr50/api/AbilityAPI.java index c59ad2cd3..a6967e34e 100644 --- a/src/main/java/com/gmail/nossr50/api/AbilityAPI.java +++ b/src/main/java/com/gmail/nossr50/api/AbilityAPI.java @@ -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; } } diff --git a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java index d634e8bb5..19d385089 100644 --- a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java @@ -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 {