Jump to content

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


Recommended Posts

Posted

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?

Posted (edited)
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
Posted
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!

Posted
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

 

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.