Jump to content

Forge Gradle 3: How to only import a mod when building project


squidlex

Recommended Posts

6 minutes ago, diesieben07 said:

You should be able to use a compileOnly dependency.

Thank you and I thought as much, however when I do this the mod is still present at runtime.

repositories {
    maven {
        name = "CurseForge"
        url = "https://minecraft.curseforge.com/api/maven/"
    }
}

dependencies {
    minecraft 'net.minecraftforge:forge:1.16.5-36.0.42'
    compileOnly "tough-as-nails:ToughAsNails-1.16.5:4.0.1.14:universal"
}

This wouldn't matter, however I'm experiencing an issue where my workspace is refusing to import access transformers from other mods, so when tough as nails is run as a dependency I get a crash.

Edited by squidlex
Link to comment
Share on other sites

2 minutes ago, diesieben07 said:

I can't reproduce this.

I added the dependency using compileOnly like you did (except I correctly used fg.deobf). When starting the game i do not get ToughAsNails loaded, but I can reference it in the code.

Okay well sorry for taking up your time as the issue is on my end. Thank you!

Link to comment
Share on other sites

24 minutes ago, diesieben07 said:

I can't reproduce this.

I added the dependency using compileOnly like you did (except I correctly used fg.deobf). When starting the game i do not get ToughAsNails loaded, but I can reference it in the code.

Sorry to be a hassle, but what command line instructions do you use?

I'm using

gradlew genEclipseRuns
gradlew eclipse

 

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.



×
×
  • Create New...

Important Information

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