cabaletta / cabaletta/baritone

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

Open
#2,329 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
9.2k
Forks
2.1k
Avg merge
4d 3h
Merged PRs (30d)
3

Description

## 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.(ClassVisitor.java:79)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at org.objectweb.asm.ClassVisitor.(ClassVisitor.java:64)
[15:41:26] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at org.objectweb.asm.tree.ClassNode.(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
```java
ClassNode clazz = new ClassNode(Opcodes.ASM7);
```

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

```java
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](https://user-images.githubusercontent.com/35858721/103579489-5efb5780-4ea6-11eb-877f-a91762df329c.png)

## 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
- [x] I know how to properly use check boxes
- [x] I have included the version of Minecraft I'm running, baritone's version and forge mods (if used).
- [x] I have included logs, exceptions and / or steps to reproduce the issue.
- [x] I have not used any OwO's or UwU's in this issue.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.