Posted January 6, 20187 yr My IDE is Eclipse, if that makes any difference. I've been adding dependent mods to the dev environment by adding the JAR as a library (Build Path > Configure Build Path...). This has worked fine for most mods. However, attempting to add Botania in this manner results in a crash, so I have been prompted to add my dependencies through build.gradle. Here is the contents my build.gradle file, using Tinker's Construct as an example: buildscript { repositories { jcenter() maven { url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' } } apply plugin: 'net.minecraftforge.gradle.forge' //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. version = "0.3" group = "turbopig.mod.tinkegration" archivesBaseName = "tinkegration" sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. compileJava { sourceCompatibility = targetCompatibility = '1.8' } minecraft { version = "1.12.2-14.23.1.2578" runDir = "run" mappings = "snapshot_20171003" makeObfSourceJar = false } repositories { maven { name 'DVS1 Maven FS' url 'http://dvs1.progwml6.com/files/maven' } } dependencies { deobfCompile "slimeknights.mantle:Mantle:1.12-1.3.1.22" deobfCompile "slimeknights:TConstruct:1.12-2.8.1.51" } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else except the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } Running setupDecompWorkspace seems to download the dependencies, yet I cannot access the mods through my own code. Specifically, "The import slimeknights cannot be resolved." I have tried: Deleting the build folder, and running setupDecompWorkspace again Running cleanCache, then setupDecompWorkspace --refresh-dependencies The above two, together What is going wrong? Thanks Edited January 6, 20187 yr by Turbo Pig Problem solved
January 6, 20187 yr Author Drats. Fortunately I already have IDEA already installed, and it appears to have Gradle support. Hopefully this fixes the problem, thanks! Quote Alternatively you must add the dependencies in both places (build.gradleand via the Eclipse GUI). Interestingly enough, I have found that adding the JARs through the Eclipse GUI was sufficient (albeit, not for Botania... but perhaps that is a different issue). Correct me if I'm wrong, but I have heard that Forge automatically includes JARs found in the /libs folder. Based on this, assuming I'm using Gradle-compatible IDE, will I have to include dependencies in the /libs folder as well? Or is adding the dependencies via build.gradle sufficient? Thanks for your patience, I don't know much about Gradle.
January 6, 20187 yr Author The build.gradle dependencies are working with IntelliJ. Switching to IDEA seems to be the right idea Thank you!
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.