mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-01 17:36:46 +01:00
Fixed loading of config for secondary abilities
This commit is contained in:
parent
ba32e725f8
commit
4d4e3a2b47
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user