Use common config parser in all modules

This commit is contained in:
makamys committed 2023-02-17 01:38:10 +01:00
1 parent fee71e8be9
commit 56b2f4c651
12 files changed
+92 -57

No files matched your search

@@ -86,8 +86,10 @@ public class AnnotatedProperties {
} else {
prop = line;
PropertyToken token = new PropertyToken(comment, prop);
PropertyToken token = new PropertyToken(new ArrayList<>(comment), prop);
tokens.put(token.key, token);
comment.clear();
}
}
} catch (Exception e) {
@@ -0,0 +1,18 @@
package io.github.legacymoddingmc.unimixins.common;
import net.minecraft.launchwrapper.Launch;
import java.io.File;
public class ConfigUtil {
public static void load(Class<?> cls) {
File oldConfigFile = new File("config/unimixins.cfg");
if(oldConfigFile.exists()) {
oldConfigFile.delete();
}
AnnotatedProperties.load(new File(Launch.minecraftHome, "config/unimixins.properties"), cls);
}
}