Updating constructors, updating node address helper methods

This commit is contained in:
nossr50
2019-02-20 22:08:46 -08:00
parent b81ca84a99
commit 6604f98140
17 changed files with 96 additions and 73 deletions

View File

@@ -45,7 +45,7 @@ public class MultiConfigContainer<T> implements Unload {
//Load Configs
//Vanilla Config
initConfigAndAddCollection(getVanillaConfigName(configPrefix));
initConfigAndAddCollection(getVanillaConfigName(configPrefix), true);
//Custom Configs
loadCustomCollections(configPrefix);
@@ -92,13 +92,13 @@ public class MultiConfigContainer<T> implements Unload {
* Initializes a config and attempts to load add its collection
* @param configFileName the filename of the config to load
*/
private void initConfigAndAddCollection(String configFileName)
private void initConfigAndAddCollection(String configFileName, Boolean copyDefaults)
{
mcMMO.p.getLogger().info("Reading from collection config - "+configFileName);
ConfigCollection configCollection = null;
try {
configCollection = (ConfigCollection) getConfigClass(collectionClassType).getConstructor(String.class).newInstance(configFileName);
configCollection = (ConfigCollection) getConfigClass(collectionClassType).getConstructor(String.class, Boolean.class).newInstance(configFileName, copyDefaults);
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
@@ -145,7 +145,7 @@ public class MultiConfigContainer<T> implements Unload {
continue;
//Load and add the collections
initConfigAndAddCollection(fileName);
initConfigAndAddCollection(fileName, false);
}
}

View File

@@ -35,7 +35,7 @@ public class RepairConfig extends ConfigCollection {
public RepairConfig(String fileName, boolean merge) {
//super(McmmoCore.getDataFolderPath().getAbsoluteFile(), fileName, false);
super(mcMMO.p.getDataFolder().getAbsoluteFile(), fileName, merge);
super(mcMMO.p.getDataFolder().getAbsoluteFile(), fileName, false, merge);
}
/**

View File

@@ -32,7 +32,7 @@ public class SalvageConfig extends ConfigCollection {
public SalvageConfig(String fileName, boolean merge) {
//super(McmmoCore.getDataFolderPath().getAbsoluteFile(), fileName, false);
super(mcMMO.p.getDataFolder().getAbsoluteFile(), fileName, merge);
super(mcMMO.p.getDataFolder().getAbsoluteFile(), fileName, false, merge);
}
/**