Commit 0b584ff19b2cec3820b15c7f4dc28623fb9f7a6f

Authored by Mumfrey
1 parent 6c1c673a

Fix launching under forge using PREINIT mixin for ClientBrandRetriever

src/client/java/com/mumfrey/liteloader/client/api/LiteLoaderCoreAPIClient.java
@@ -47,6 +47,7 @@ public class LiteLoaderCoreAPIClient extends LiteLoaderCoreAPI @@ -47,6 +47,7 @@ public class LiteLoaderCoreAPIClient extends LiteLoaderCoreAPI
47 47
48 private static final String[] clientMixinConfigs = new String[] { 48 private static final String[] clientMixinConfigs = new String[] {
49 "mixins.liteloader.client.json", 49 "mixins.liteloader.client.json",
  50 + "mixins.liteloader.client.preinit.json",
50 "mixins.liteloader.client.optional.json", 51 "mixins.liteloader.client.optional.json",
51 }; 52 };
52 53
src/client/resources/mixins.liteloader.client.json
@@ -24,7 +24,6 @@ @@ -24,7 +24,6 @@
24 "MixinGuiTextField", 24 "MixinGuiTextField",
25 "MixinIntIdentityHashBiMap", 25 "MixinIntIdentityHashBiMap",
26 "MixinGuiOverlayDebug", 26 "MixinGuiOverlayDebug",
27 - "MixinClientBrandRetriever",  
28 "IGuiButton", 27 "IGuiButton",
29 "IKeyBinding" 28 "IKeyBinding"
30 ], 29 ],
src/client/resources/mixins.liteloader.client.preinit.json 0 → 100644
  1 +{
  2 + "required": true,
  3 + "minVersion": "0.7.4",
  4 + "compatibilityLevel": "JAVA_8",
  5 + "target": "@env(PREINIT)",
  6 + "package": "com.mumfrey.liteloader.client.mixin",
  7 + "refmap": "mixins.liteloader.client.refmap.json",
  8 + "mixins": [
  9 + "MixinClientBrandRetriever"
  10 + ],
  11 + "injectors": {
  12 + "defaultRequire": 1
  13 + }
  14 +}
0 \ No newline at end of file 15 \ No newline at end of file
src/main/java/com/mumfrey/liteloader/launch/LiteLoaderTweaker.java
@@ -44,6 +44,37 @@ public class LiteLoaderTweaker implements ITweaker @@ -44,6 +44,37 @@ public class LiteLoaderTweaker implements ITweaker
44 44
45 protected static final String BOOTSTRAP_CLASS = "com.mumfrey.liteloader.core.LiteLoaderBootstrap"; 45 protected static final String BOOTSTRAP_CLASS = "com.mumfrey.liteloader.core.LiteLoaderBootstrap";
46 private static final String CLIENT_API = "com.mumfrey.liteloader.client.api.LiteLoaderCoreAPIClient"; 46 private static final String CLIENT_API = "com.mumfrey.liteloader.client.api.LiteLoaderCoreAPIClient";
  47 +
  48 + public static class PreInitTweaker implements ITweaker
  49 + {
  50 + public PreInitTweaker()
  51 + {
  52 + MixinService.getService().beginPhase();
  53 + }
  54 +
  55 + @Override
  56 + public void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile)
  57 + {
  58 + }
  59 +
  60 + @Override
  61 + public void injectIntoClassLoader(LaunchClassLoader classLoader)
  62 + {
  63 + }
  64 +
  65 + @Override
  66 + public String getLaunchTarget()
  67 + {
  68 + return "";
  69 + }
  70 +
  71 + @Override
  72 + public String[] getLaunchArguments()
  73 + {
  74 + return new String[0];
  75 + }
  76 +
  77 + }
47 78
48 /** 79 /**
49 * Loader startup state 80 * Loader startup state
@@ -272,6 +303,8 @@ public class LiteLoaderTweaker implements ITweaker @@ -272,6 +303,8 @@ public class LiteLoaderTweaker implements ITweaker
272 LiteLoaderLogger.info("Queuing required class transformer '%s'", transformerClassName); 303 LiteLoaderLogger.info("Queuing required class transformer '%s'", transformerClassName);
273 this.transformerManager.injectTransformer(transformerClassName); 304 this.transformerManager.injectTransformer(transformerClassName);
274 } 305 }
  306 +
  307 + LiteLoaderTweaker.injectTweakClass("com.mumfrey.liteloader.launch.LiteLoaderTweaker$PreInitTweaker");
275 } 308 }
276 309
277 /* (non-Javadoc) 310 /* (non-Javadoc)