Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

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


Recommended Posts

Hi!

 

My mod has integration for a bunch of other mods that I don't want to run in my testing environment, however I need the import to ensure I can actually build my project. Is there a way I can only import them at runtime?

Link to post
Share on other sites
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 post
Share on other sites

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.

  • Thanks 1
Link to post
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 post
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 post
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.

Guest
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 Privacy Policy.