Jump to content

How to create a jar file, that can be included as dependency in another project?


Recommended Posts

Posted

I've posted my question already, but I still don't know what to do.

I have a mod finished (lets call it mod A), which I want to distribute via mavenCentral so other devs can use its API. Before I upload the jar I would like to test it locally with another mod (mod B). Thats why I have this in the build.gradle file of mod B:

dependencies {
    minecraft "net.minecraftforge:forge:${version_forge}"
	
	implementation fg.deobf(files('C:/Minecraft Modding/ElementalCombat/build/libs/elementalcombat-forge-1.16.5-1.1.1.jar'))
}

This will import the jar into the project succesfully. However when I try to run mod B mod A will run into a FieldNotFound exception in its init phase. The field from the exception has an obfuscated name, which it didn't had before building the jar. So my best guess is, that something went wrong when (de-)obfuscating the jar. But I don't know how I can fix this.

My repositories can be found here:
https://github.com/Tavi007/ElementalCombat (aka mod A)
https://github.com/Tavi007/ElementalCombat-Weaponry (aka mod B)

The line, that causes the exception:
https://github.com/Tavi007/ElementalCombat/blob/b562cba34d2bee7a647aa4d088372c917d67a3d4/src/main/java/Tavi007/ElementalCombat/init/EnchantmentList.java#L39

I really hope, someone can help me. This is the last issue, that I need to fix, before I can release my mod :)

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.