Syndaryl Posted November 20, 2015 Posted November 20, 2015 I wrote a little utility to get the class names of all the monsters from all my loaded mods, so I can set up iChun's morph mod to support all my mods I made a cruddy little wand that when you right click it, it dumps all the mob classnames to a log file. This means I can be sure I'm dumping my list after all mods have initialized and created their monsters. It relies on a library that isn't part of my mod, Minecraft, Forge, or the standard Java distribution; the library is org.reflections from https://github.com/ronmamo/reflections I built the library locally using maven, it works if I make little programs testing it in eclipse so I'm pretty sure it's built right. It was built into "reflections-0.9.11-SNAPSHOT.jar" Unfortunately, while I can build (with gradle) my code using the library, when I right-click my wand and invoke org.reflections, Minecraft dies with a java.lang.NoClassDefFoundError (specifically complaining about org.reflections). What I've done: I've added reflections-0.9.11-SNAPSHOT.jar to the libs folder in my project. I added the following to my build.gradle dependencies { compile files( 'reflections-0.9.11-SNAPSHOT.jar' ) } That lets everything build nicely, but as mentioned Minecraft throws a java.lang.NoClassDefFoundError in the onItemRightClick on my object as it creates a new org.reflections.Reflections. I tried using -classpath to tell java where my built classes for org.reflections are, and then where the buit jar was, when starting Minecraft but no behavior change. I experimentally copied reflections-0.9.11-SNAPSHOT.jar into my mods folder, but it didn't change the behavior, presumably because the library is not a mod, so Forge doesn't load it. And then, flailing a little, I moved it into mods\1.7.10 but naturally that doesn't work either. As another experiment, I cracked open my mod and the reflections .jar, and merged the contents into my mod. I really would have thought that would make the classes visible but no change. Sad panda. I'm flailing around a bit much so now I come to you to find out how I'm supposed to use this external library jar with my mod? Please? Quote
Syndaryl Posted November 20, 2015 Author Posted November 20, 2015 AHA, "Shade", that's the magic word! Thanks much. Quote
Syndaryl Posted November 21, 2015 Author Posted November 21, 2015 OK, I'm back. Gradle and I are having an argument still, this time about the srgExtra line. I read through the entire Shading article, and I looked at the sample Shading recipe. I just can't get it to build. Reveal hidden contents :reobf FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':reobf'. > Unable to parse srg file, unrecognized mapping type in line=CL:org/reflections/* com/syndaryl/minecraft/dumpentitylist/org/reflections/* I've put my project up on git, the build.gradle is at https://github.com/Syndaryl/dumpentitylist/blob/master/build.gradle I tried a PK (package) based remap first, that failed too. As far as I can tell from the source, CL and PK should be the part being referred to for that error, but those are also, according to the source, correct. I feel like I must be just a little bit off somewhere. Quote
Syndaryl Posted November 21, 2015 Author Posted November 21, 2015 It's building again. Minecraft is still crashing when I click, but I accidentally trashed the log so I'm rerunning that and doing some more testing to see what the ding dang issue is. Quote
Syndaryl Posted November 21, 2015 Author Posted November 21, 2015 Ah, it needs another library. Well, now I'm at the point where I can just keep jamning them in my fatjar until Minecraft stops complaining at me Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.