mirror of
https://github.com/LegacyModdingMC/UniMixins.git
synced 2026-11-21 12:52:16 +00:00
Use common config parser in all modules
This commit is contained in:
1 parent
fee71e8be9
commit
56b2f4c651
12 files changed
+92
-57
No files matched your search
+3
-1
@@ -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) {
|
||||
|
||||
+18
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user