Commit c9b4172fcfc8572f1558a3c0db0bf6ec635109d5

Authored by Mumfrey
1 parent aa2b1973

Fix realms screen mixin for realms 1.9.8 and make it optional, fixes #15

src/client/java/com/mumfrey/liteloader/client/api/LiteLoaderCoreAPIClient.java
... ... @@ -46,14 +46,18 @@ public class LiteLoaderCoreAPIClient extends LiteLoaderCoreAPI
46 46 LiteLoaderCoreAPI.PKG_LITELOADER + ".transformers.event.json.ModEventInjectionTransformer"
47 47 };
48 48  
  49 + private static final String[] clientMixinConfigs = new String[] {
  50 + "mixins.liteloader.client.json",
  51 + "mixins.liteloader.client.optional.json",
  52 + };
  53 +
49 54 private ObjectFactory<Minecraft, IntegratedServer> objectFactory;
50 55  
51 56 @Override
52 57 public String[] getMixinConfigs()
53 58 {
54 59 String[] commonConfigs = super.getMixinConfigs();
55   - String[] clientConfigs = new String[] { "mixins.liteloader.client.json" };
56   - return ObjectArrays.concat(commonConfigs, clientConfigs, String.class);
  60 + return ObjectArrays.concat(commonConfigs, LiteLoaderCoreAPIClient.clientMixinConfigs, String.class);
57 61 }
58 62  
59 63 /* (non-Javadoc)
... ...
src/client/java/com/mumfrey/liteloader/client/mixin/MixinRealmsMainScreen.java
... ... @@ -19,8 +19,11 @@ import net.minecraft.realms.RealmsScreen;
19 19 @Mixin(value = RealmsMainScreen.class, remap = false)
20 20 public abstract class MixinRealmsMainScreen extends RealmsScreen
21 21 {
22   - @Inject(method = "play(Lcom/mojang/realmsclient/dto/RealmsServer;)V", at = @At("HEAD"))
23   - private void onJoinRealm(RealmsServer server, CallbackInfo ci)
  22 + @Inject(
  23 + method = "play(Lcom/mojang/realmsclient/dto/RealmsServer;Lnet/minecraft/realms/RealmsScreen;)V",
  24 + at = @At("HEAD")
  25 + )
  26 + private void onJoinRealm(RealmsServer server, RealmsScreen screen, CallbackInfo ci)
24 27 {
25 28 PacketEventsClient.onJoinRealm(server);
26 29 }
... ...
src/client/resources/mixins.liteloader.client.json
... ... @@ -14,7 +14,6 @@
14 14 "MixinFramebuffer",
15 15 "MixinIntegratedServer",
16 16 "MixinScreenShotHelper",
17   - "MixinRealmsMainScreen",
18 17 "MixinNetHandlerLoginClient",
19 18 "MixinRegistrySimple",
20 19 "MixinRegistryNamespaced",
... ...
src/client/resources/mixins.liteloader.client.optional.json 0 → 100644
  1 +{
  2 + "required": false,
  3 + "minVersion": "0.5.10",
  4 + "target": "@env(DEFAULT)",
  5 + "package": "com.mumfrey.liteloader.client.mixin",
  6 + "refmap": "mixins.liteloader.client.refmap.json",
  7 + "mixins": [
  8 + "MixinRealmsMainScreen"
  9 + ]
  10 +}
0 11 \ No newline at end of file
... ...