Removing dead symbols from ConfigManager

This commit is contained in:
nossr50 2019-09-20 15:54:38 -07:00
parent 7c0d1f4e0a
commit 396926d970
3 changed files with 71 additions and 103 deletions

View File

@ -40,72 +40,72 @@ public class ConfigConstants {
EXAMPLE_BLACKLIST_WORLDS_LIST_DEFAULT.add(EXAMPLE_BLACKLIST_WORLDS[2]); EXAMPLE_BLACKLIST_WORLDS_LIST_DEFAULT.add(EXAMPLE_BLACKLIST_WORLDS[2]);
} }
/** // /**
* Return the data folder for mcMMO // * Return the data folder for mcMMO
* // *
* @return the File for the data folder used by mcMMO // * @return the File for the data folder used by mcMMO
*/ // */
public static File getDataFolder() { // public static File getDataFolder() {
return pluginRef.getDataFolder(); // return pluginRef.getDataFolder();
} // }
//
public static File getConfigFolder() { // public static File getConfigFolder() {
return new File(getDataFolder(), FOLDER_NAME_CONFIG); // return new File(getDataFolder(), FOLDER_NAME_CONFIG);
} // }
//
public static File getDefaultsFolder() { // public static File getDefaultsFolder() {
return new File(getConfigFolder().getAbsolutePath(), FOLDER_NAME_DEFAULTS); // return new File(getConfigFolder().getAbsolutePath(), FOLDER_NAME_DEFAULTS);
} // }
//
public static File getDefaultsConfigFolder() { // public static File getDefaultsConfigFolder() {
return new File(getDefaultsFolder().getAbsolutePath(), FOLDER_NAME_CONFIG); // return new File(getDefaultsFolder().getAbsolutePath(), FOLDER_NAME_CONFIG);
} // }
//
public static File getDefaultsSkillFolder() { // public static File getDefaultsSkillFolder() {
return new File(getDefaultsConfigFolder().getAbsolutePath(), FOLDER_NAME_SKILLS); // return new File(getDefaultsConfigFolder().getAbsolutePath(), FOLDER_NAME_SKILLS);
} // }
//
public static File getDefaultsXPFolder() { // public static File getDefaultsXPFolder() {
return new File(getDefaultsConfigFolder().getAbsolutePath(), FOLDER_NAME_EXPERIENCE); // return new File(getDefaultsConfigFolder().getAbsolutePath(), FOLDER_NAME_EXPERIENCE);
} // }
//
public static File getConfigSkillFolder() { // public static File getConfigSkillFolder() {
return new File(getConfigFolder().getAbsolutePath(), FOLDER_NAME_SKILLS); // return new File(getConfigFolder().getAbsolutePath(), FOLDER_NAME_SKILLS);
} // }
//
public static File getConfigXPFolder() { // public static File getConfigXPFolder() {
return new File(getConfigFolder().getAbsolutePath(), FOLDER_NAME_EXPERIENCE); // return new File(getConfigFolder().getAbsolutePath(), FOLDER_NAME_EXPERIENCE);
} // }
//
/** // /**
* Creates all directories used by mcMMO config files // * Creates all directories used by mcMMO config files
*/ // */
public static void makeAllConfigDirectories() { // public static void makeAllConfigDirectories() {
/* CONFIG DIRECTORY */ // /* CONFIG DIRECTORY */
//
if (!getConfigFolder().exists()) // if (!getConfigFolder().exists())
getConfigFolder().mkdirs(); // getConfigFolder().mkdirs();
//
/* DEFAULT DIRECTORIES */ // /* DEFAULT DIRECTORIES */
//
if (!getDefaultsFolder().exists()) // if (!getDefaultsFolder().exists())
getDefaultsFolder().mkdirs(); // getDefaultsFolder().mkdirs();
//
if (!getDefaultsConfigFolder().exists()) // if (!getDefaultsConfigFolder().exists())
getDefaultsConfigFolder().mkdirs(); // getDefaultsConfigFolder().mkdirs();
//
if (!getDefaultsSkillFolder().exists()) // if (!getDefaultsSkillFolder().exists())
getDefaultsSkillFolder().mkdirs(); // getDefaultsSkillFolder().mkdirs();
//
if (!getDefaultsXPFolder().exists()) // if (!getDefaultsXPFolder().exists())
getDefaultsXPFolder().mkdirs(); // getDefaultsXPFolder().mkdirs();
//
/* CONFIG SUBDIRECTORIES */ // /* CONFIG SUBDIRECTORIES */
//
if (!getConfigSkillFolder().exists()) // if (!getConfigSkillFolder().exists())
getConfigSkillFolder().mkdirs(); // getConfigSkillFolder().mkdirs();
//
if (!getConfigXPFolder().exists()) // if (!getConfigXPFolder().exists())
getConfigXPFolder().mkdirs(); // getConfigXPFolder().mkdirs();
} // }
} }

View File

@ -47,9 +47,6 @@ import com.gmail.nossr50.config.hocon.sound.ConfigSound;
import com.gmail.nossr50.config.hocon.sound.SoundSetting; import com.gmail.nossr50.config.hocon.sound.SoundSetting;
import com.gmail.nossr50.config.hocon.superabilities.ConfigSuperAbilities; import com.gmail.nossr50.config.hocon.superabilities.ConfigSuperAbilities;
import com.gmail.nossr50.config.hocon.worldblacklist.ConfigWorldBlacklist; import com.gmail.nossr50.config.hocon.worldblacklist.ConfigWorldBlacklist;
import com.gmail.nossr50.config.treasure.ExcavationTreasureConfig;
import com.gmail.nossr50.config.treasure.FishingTreasureConfig;
import com.gmail.nossr50.config.treasure.HerbalismTreasureConfig;
import com.gmail.nossr50.datatypes.experience.CustomXPPerk; import com.gmail.nossr50.datatypes.experience.CustomXPPerk;
import com.gmail.nossr50.datatypes.experience.FormulaType; import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.datatypes.items.ItemMatch; import com.gmail.nossr50.datatypes.items.ItemMatch;
@ -140,18 +137,6 @@ public final class ConfigManager {
//Data //Data
private SerializedConfigLoader<ConfigPartyData> partyData; private SerializedConfigLoader<ConfigPartyData> partyData;
//YAML CONFIGS
private MainConfig mainConfig;
private FishingTreasureConfig fishingTreasureConfig;
private ExcavationTreasureConfig excavationTreasureConfig;
private HerbalismTreasureConfig herbalismTreasureConfig;
private AdvancedConfig advancedConfig;
/* CONFIG ERRORS */
private ArrayList<String> configErrors; //Collect errors to whine about to server admins
public ConfigManager(mcMMO pluginRef) { public ConfigManager(mcMMO pluginRef) {
this.pluginRef = pluginRef; this.pluginRef = pluginRef;
userFiles = new ArrayList<>(); userFiles = new ArrayList<>();
@ -341,26 +326,6 @@ public final class ConfigManager {
return userFiles; return userFiles;
} }
public MainConfig getMainConfig() {
return mainConfig;
}
public FishingTreasureConfig getFishingTreasureConfig() {
return fishingTreasureConfig;
}
public ExcavationTreasureConfig getExcavationTreasureConfig() {
return excavationTreasureConfig;
}
public HerbalismTreasureConfig getHerbalismTreasureConfig() {
return herbalismTreasureConfig;
}
public AdvancedConfig getAdvancedConfig() {
return advancedConfig;
}
public ConfigCoreSkills getConfigCoreSkills() { public ConfigCoreSkills getConfigCoreSkills() {
return configCoreSkills.getConfig(); return configCoreSkills.getConfig();
} }

View File

@ -197,6 +197,9 @@ public class FishingManager extends SkillManager {
public double getShakeChance() { public double getShakeChance() {
return AdvancedConfig.getInstance().getShakeChance(getLootTier()); return AdvancedConfig.getInstance().getShakeChance(getLootTier());
} }
public double getShakeChance() {
return pluginRef.getConfigManager().getFishingTreasureConfig().getShakeChance(getLootTier());
}
public int getInnerPeaceMultiplier() { public int getInnerPeaceMultiplier() {
return pluginRef.getConfigManager().getConfigFishing().getVanillaXPMultInnerPeace(pluginRef.getRankTools().getRank(getPlayer(), SubSkillType.FISHING_INNER_PEACE)); return pluginRef.getConfigManager().getConfigFishing().getVanillaXPMultInnerPeace(pluginRef.getRankTools().getRank(getPlayer(), SubSkillType.FISHING_INNER_PEACE));