Jump to content

Using another mod's jar as a library


M4thG33k

Recommended Posts

I'm trying to use another mod as a library in order access items/blocks/etc. I have created a /mylibs/ directory at the same level as my build.gradle file (https://goo.gl/UhZ3Wq) and have placed the jar (SilentsGems-1.8.9-1.3.10b-106.jar) into this directory. Upon running "gradlew setupDecompWorkspace", I get the following error:

 

"* What went wrong:

Execution failed for task ':deobfCompileDeobfDepTask0'.

> java.util.zip.ZipException: invalid entry compressed size (expected 7547 but got 7802 bytes)"

 

I'm not sure where to go from here. Any insight would be extremely helpful. (What did I screw up or is there a better/different method for doing this? The repository for the mod I'm attempting to add onto is open-source on github, if that makes any difference - there just isn't a deobf jar available to me.) Thanks in advance!

Able to differentiate the difference of a sum and an integral.

Link to comment
Share on other sites

coolAlias: But putting the jar in the /mods/ folder doesn't allow me access to the classes/methods in the mod, which I want to be able to use in my add-on.

 

Dylem: That tutorial uses only a deobf jar file, which I don't have access to.

 

(Using IntelliJ and in 1.8.9, in case that wasn't clear...sorry.)

Able to differentiate the difference of a sum and an integral.

Link to comment
Share on other sites

In 1.8.9 FML can deobfuscate mods at runtime, so there's no need for deobfuscated builds any more.

 

Anything in the libs directory at the same level as the build.gradle file will automatically be added as a dependency by Gradle.

 

You can also manually add dependencies; using the

deobfCompile

/

deobfProvided

configurations will tell ForgeGradle to deobfuscate the dependency on disk.

 

As for your actual issue, it looks like the JAR may be corrupt. Can you open it in an archive viewer like 7-Zip? Can you load it as a mod in the non-development client?

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

This actually worked (and was the simplest solution anyone has given me). Thank you so much! Will there be anything special I'll need to do at compile time in order for my mod to work correctly?

Able to differentiate the difference of a sum and an integral.

Link to comment
Share on other sites

This actually worked (and was the simplest solution anyone has given me). Thank you so much! Will there be anything special I'll need to do at compile time in order for my mod to work correctly?

There shouldn't be.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

  • 2 years later...
20 minutes ago, Valoeghese said:

Any Ideas on how to do this in 1.12? I don't see a libs folder in the same directory as build.gradle

 

There isn't one by default, you need to create it. This hasn't changed since 1.8.9.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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