rewire getInstance for experience config

This commit is contained in:
nossr50 2019-02-18 09:08:16 -08:00
parent f08456b789
commit 63aebd0454
3 changed files with 22 additions and 9 deletions

View File

@ -2,6 +2,7 @@ package com.gmail.nossr50.config;
import com.gmail.nossr50.config.collectionconfigs.CollectionClassType;
import com.gmail.nossr50.config.collectionconfigs.MultiConfigContainer;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.config.skills.alchemy.PotionConfig;
import com.gmail.nossr50.config.treasure.TreasureConfig;
import com.gmail.nossr50.skills.repair.repairables.Repairable;
@ -44,6 +45,7 @@ public final class ConfigManager {
private MainConfig mainConfig;
private TreasureConfig treasureConfig;
private ExperienceConfig experienceConfig;
private AdvancedConfig advancedConfig;
private PotionConfig potionConfig;
private CoreSkillsConfig coreSkillsConfig;
@ -71,6 +73,10 @@ public final class ConfigManager {
advancedConfig = new AdvancedConfig();
unloadables.add(advancedConfig);
//TODO: Not sure about the order of experience config
experienceConfig = new ExperienceConfig();
unloadables.add(experienceConfig);
potionConfig = new PotionConfig();
unloadables.add(potionConfig);
@ -83,9 +89,6 @@ public final class ConfigManager {
rankConfig = new RankConfig();
unloadables.add(rankConfig);
//TODO: This config serves no purpose so its getting removed
new ChildConfig();
/*if (MainConfig.getInstance().getToolModsEnabled()) {
new ToolConfigManager();
}
@ -209,4 +212,8 @@ public final class ConfigManager {
public RankConfig getRankConfig() {
return rankConfig;
}
public ExperienceConfig getExperienceConfig() {
return experienceConfig;
}
}

View File

@ -1,6 +1,7 @@
package com.gmail.nossr50.config.experience;
import com.gmail.nossr50.config.ConfigValidated;
import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
@ -77,17 +78,21 @@ public class ExperienceConfig extends ConfigValidated {
private static ExperienceConfig instance;
//TODO: Should merge be false? Seems okay to leave it as true..
private ExperienceConfig() {
public ExperienceConfig() {
//super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "experience.yml", true);
super(mcMMO.p.getDataFolder().getAbsoluteFile(), "experience.yml", true);
}
/**
* This grabs an instance of this config class from the Config Manager
* This method is deprecated and will be removed in the future
* @see mcMMO#getConfigManager()
* @return the instance of this config
* @deprecated Please use mcMMO.getConfigManager() to grab a specific config instead
*/
@Deprecated
public static ExperienceConfig getInstance() {
if (instance == null) {
instance = new ExperienceConfig();
}
return instance;
return mcMMO.getConfigManager()
}
/**

View File

@ -1,6 +1,7 @@
package com.gmail.nossr50.datatypes.skills;
import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.SkillManager;