Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

Baritone uses older version of ASM than cpw.mods.modlauncher, Game won't load due to invalid ASM version

Techcraft7 opened this issue ยท 0 comments

commented

Info

Operating system: Windows 10
Java version: 1.8 (OpenJDK)
Minecraft version: 1.16.4
Baritone version: 1.6.2
Forge mods (if used): none

Logs

[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: java.lang.IllegalArgumentException
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:79)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:64)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at org.objectweb.asm.tree.ClassNode.<init>(ClassNode.java:209)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:70)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:265)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:136)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.lang.Class.forName0(Native Method)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.lang.Class.forName(Class.java:348)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at org.spongepowered.asm.service.modlauncher.ModLauncherClassProvider.findClass(ModLauncherClassProvider.java:57)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at org.spongepowered.asm.launch.platform.MixinConnectorManager.loadConnectors(MixinConnectorManager.java:71)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at org.spongepowered.asm.launch.platform.MixinConnectorManager.inject(MixinConnectorManager.java:60)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at org.spongepowered.asm.launch.platform.MixinPlatformManager.inject(MixinPlatformManager.java:197)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at org.spongepowered.asm.launch.MixinBootstrap.inject(MixinBootstrap.java:190)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at org.spongepowered.asm.launch.MixinLaunchPlugin.initializeLaunch(MixinLaunchPlugin.java:196)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchPluginHandler.lambda$announceLaunch$9(LaunchPluginHandler.java:97)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.util.HashMap.forEach(HashMap.java:1289)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchPluginHandler.announceLaunch(LaunchPluginHandler.java:97)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:52)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105)

Process finished with exit code 1

How to reproduce

  1. Create a project
  2. Add baritone as a dependency
  3. gradlew runClient
  4. Game exits

Reason

cpw.mods.modlauncher attempts to create a ClassNode with API version 7 (Opcodes.ASM7):

https://github.com/cpw/modlauncher/blob/master/src/main/java/cpw/mods/modlauncher/ClassTransformer.java#L70

ClassNode clazz = new ClassNode(Opcodes.ASM7);

Upon viewing the constructor of ClassNode, and viewing the super class constructors, I found this:

public ClassVisitor(int api, ClassVisitor cv) {
    if (api != Opcodes.ASM4 && api != Opcodes.ASM5) {
        throw new IllegalArgumentException(); // <- This is the exception throw from the log above
    } else {
        this.api = api;
        this.cv = cv;
    }
}

I looked at the dependency tree in IntelliJ, and saw this:
image

Modified settings

Due to this bug I have not been able to run the game. It never reaches the title screen

Solution

Update ASM to the same as cpw.mods.modlauncher

Dumb solution for now

  • Add ASM 7.2 as a dependency to your project (But now I cant run it in a dev environment because when mixin attempts to patch obfuscated methods it crashes, Does anyone know how to fix this?)

Final checklist

  • I know how to properly use check boxes
  • I have included the version of Minecraft I'm running, baritone's version and forge mods (if used).
  • I have included logs, exceptions and / or steps to reproduce the issue.
  • I have not used any OwO's or UwU's in this issue.