Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

"java.lang.NoClassDefFoundError: ain" when calling "BaritoneAPI.getProvider()"

SamHDev opened this issue ยท 8 comments

commented

Hello, I'm an in-experienced java developer who doesn't know what the f*ck I'm doing. I'm making this issue under the request of a discord member within the Impact Server.

I'm trying to use the BaritoneAPI within a forge mod (1.12.2) however I get this error when executing the following code:

IBaritoneProvider provider = BaritoneAPI.getProvider();
IBaritone baritone = provider.getPrimaryBaritone(); ICustomGoalProcess process = baritone.getCustomGoalProcess();
process.setGoal(new GoalBlock(x, y, z));
process.path();
 java.lang.NoClassDefFoundError: ain
 	at baritone.api.Settings.<init>(Unknown Source)
 	at baritone.api.BaritoneAPI.<clinit>(Unknown Source)
 	at shd.bachitone.net.BachitoneServer.clientHandler(BachitoneServer.java:250)
 	at shd.bachitone.net.BachitoneServer.serverAcceptLoop(BachitoneServer.java:263)
 	at shd.bachitone.net.BachitoneServer$2.run(BachitoneServer.java:280)
 	at java.lang.Thread.run(Thread.java:748)
 Caused by: java.lang.ClassNotFoundException: ain
 	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)
 	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
 	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
 	... 6 more
 Caused by: java.lang.NullPointerException

I presume that is cause by importing BaritoneAPI or using BaritoneAPI.getProvider()) without baritone within my classpath? (I have no idea what I'm doing)
I'm using the baritione-api-forge.1.2.13.jar within my project libraries, but If i place the standalone or standalone-forge within my libraries it does not work, and If I place any baritone jar, forge or not within the mods directory I get more errors.

Any help would be greatly appreciated.
Thanks
-Sam

Final checklist

  • [ x ] I know how to properly use checkboxes
  • [ x ] I have not used any OwO's or UwU's in this issue.
commented

Because you're using a jar with obfuscated mappings against a testing development, clearly not obfuscated.

commented

So how would I fix this? From my limited knowledge, obfuscation takes functions/classes and renames them to smaller terms. Would I de-obfuscate the jar, How would that happen?

commented

Um, don't run the obfuscated jar, or disable obfuscation in your build.gradle entirely

commented

gradlew jar.....

commented

I'm having the same issue using forge-api or unoptimized
baritone is included via compile fileTree(dir: 'libs', include: ['*.jar']) in build.gradle (jar is in libs/)
im also new with forge

commented

Just generate a jar without obfuscated mapping using gradlew jar and use that one as dependency???

commented

Duplicate of #853 iirc.

commented

still crashing but its a different bug lol so fixed i guess?
I'll open a new question