Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

  • Author

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.

 

 

: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.

  • Author

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.

  • Author

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 :P

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.