Posted April 13, 20169 yr Hello I have two mods I have been developing in parallel: a "core" Library and an "addon". During development, I had both mods in the same workspace and added the core library project to the build path of the addon project and everything worked perfectly. In order to build the addon project via gradle, I had to make a deobf jar of the core library and put it in ./libs (I thought a deobf version was no longer necessary because FG deobfuscated at runtime, but it wouldn't compile otherwise). Once again, everything builds and runs perfectly under gradle (gradlew runClient) However, when I try to run both mods (the normal, obfuscated versions) in a normal Minecraft instance, I get the following crash: http://pastebin.com/cgmkhTJw The error seems to be the addon complaining about a "missing" class in the core library, but that class does exist in the jar that is in the mods folder. I have tried rebuilding both mods a few times and checking that all classes were correctly compiled and included in the jar, and I tried running in both MultiMC and the Curse launcher, but I can't figure out why its not working. Any ideas?
April 13, 20169 yr Author no, the class that's not found is in the jar file (which is the weird part), and it is under src/main/java/ in the dev workspace
April 14, 20169 yr I have two mods I have been developing in parallel: a "core" and an "addon". Core mods don't mix well with Forge. Skip the core mod and just make the add-on. The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.
April 14, 20169 yr Author Here it is. Also, the code for the addon: https://github.com/Xilef11/runesofwizardry-classics
April 14, 20169 yr not core as in coremod, core as in "library" Then name it Library, coremods have bad connotations in MC. Don't confuse people. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
April 16, 20169 yr Author I've been messing around with this a bit more, and I can't figure out what's wrong... My guess is that something is not being built properly, but I can't find what. Build script for deobf jar Build script for the addon All three (deobf, normal and addon) jar files: http://ge.tt/7zcR9jZ2 Once again, everything builds properly with deobf jar in ./libs, but crashes with normal + addon jars in a normal minecraft instance
April 18, 20169 yr Author I did a few more tests, and I think I found a possible cause for the problem: In the addon's @Mod annotation, it seems that putting 'required-after' instead of 'required-before' for the dependency on the library prevents the NoClassDefFound exception. (I don't see how the load order affects the classpath, but that's a side of Forge I don't know about ) However, this causes a problem: It is necessary that all addons have completed their preinit sequence before the library. This is because the library will register a custom model for some of the addon's items, which must be done in preinit (as well as registering items). (It is also preferable that the addons complete their init and postinit sequences before the library) A solution could obviously be to have a method in the library to register the custom models and make the addons call it during preinit, but I don't think it is very elegant because it requires extra work on the addon's side for the "normal" behaviour. Is there an explanation or solution for this problem?
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.