From ed8611585f62fa3d6f13ee9a19bfb8dcee6f54bf Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 26 Feb 2019 20:49:45 -0800 Subject: [PATCH] remove reflection code from MultiConfigContainer --- .../collectionconfigs/MultiConfigContainer.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/collectionconfigs/MultiConfigContainer.java b/src/main/java/com/gmail/nossr50/config/collectionconfigs/MultiConfigContainer.java index 39f8355f2..480012160 100644 --- a/src/main/java/com/gmail/nossr50/config/collectionconfigs/MultiConfigContainer.java +++ b/src/main/java/com/gmail/nossr50/config/collectionconfigs/MultiConfigContainer.java @@ -5,7 +5,6 @@ import com.gmail.nossr50.config.Unload; import com.gmail.nossr50.mcMMO; import java.io.File; -import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collection; import java.util.regex.Pattern; @@ -99,7 +98,14 @@ public class MultiConfigContainer implements Unload { mcMMO.p.getLogger().info("Reading from collection config - "+fileName); ConfigCollection configCollection = null; - try { + if(collectionClassType == CollectionClassType.REPAIR) + { + configCollection = new RepairConfig(fileName, merge, copyDefaults); + } else { + configCollection = new SalvageConfig(fileName, merge, copyDefaults); + } + + /*try { //String parentFolderPath, String relativePath, boolean mergeNewKeys, boolean copyDefaults, boolean removeOldKeys //String fileName, boolean merge, boolean copyDefaults configCollection = (ConfigCollection) getConfigClass(collectionClassType).getConstructor(String.class, Boolean.class, Boolean.class).newInstance(fileName, merge, copyDefaults); @@ -111,7 +117,7 @@ public class MultiConfigContainer implements Unload { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); - } + }*/ //Add the collection loaded from this config addCollection(configCollection.getLoadedCollection());