aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-12 12:21:59 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-12 12:21:59 +0200
commit4aea11fd22e72c7766c461285ec108f8cbda2659 (patch)
treeabed408802607140753fe9915143558f8e319ff3 /src/main
parentd34feb844550ad08691dfafe6b7bf50b14611c7a (diff)
parent636df2c2b3b8e4aa0de64cf3b9aa5c089afd70a9 (diff)
downloadOneConfig-4aea11fd22e72c7766c461285ec108f8cbda2659.tar.gz
OneConfig-4aea11fd22e72c7766c461285ec108f8cbda2659.tar.bz2
OneConfig-4aea11fd22e72c7766c461285ec108f8cbda2659.zip
Merge branch 'master' of github.com:Polyfrost/OneConfig
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/internal/init/OneConfigInit.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/init/OneConfigInit.java b/src/main/java/cc/polyfrost/oneconfig/internal/init/OneConfigInit.java
index 3d924ac..4d80f4d 100644
--- a/src/main/java/cc/polyfrost/oneconfig/internal/init/OneConfigInit.java
+++ b/src/main/java/cc/polyfrost/oneconfig/internal/init/OneConfigInit.java
@@ -4,12 +4,32 @@ import net.minecraft.launchwrapper.Launch;
import org.spongepowered.asm.launch.MixinBootstrap;
import org.spongepowered.asm.mixin.Mixins;
+import java.io.File;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+
@SuppressWarnings("unused")
public class OneConfigInit {
public static void initialize(String[] args) {
Launch.blackboard.put("oneconfig.initialized", true);
MixinBootstrap.init();
+ if (Launch.blackboard.containsKey("oneconfig.wrapper.modFile")) {
+ try {
+ File modFile = (File) Launch.blackboard.get("oneconfig.wrapper.modFile");
+ try (JarFile jarFile = new JarFile(modFile)) {
+ Manifest manifest = jarFile.getManifest();
+ if (manifest != null) {
+ String mixinConfigs = manifest.getMainAttributes().getValue("MixinConfigs");
+ if (mixinConfigs != null) {
+ Mixins.addConfiguration(mixinConfigs);
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
Mixins.addConfiguration("mixins.oneconfig.json");
}
}