Jump to content

[1.12.2] [SOLVED] Adding a mod to the dev environment via build.gradle


Recommended Posts

Posted (edited)

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 by Turbo Pig
Problem solved
Posted

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.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
    • Maybe you need to create file in assets/<modid>/items/<itemname>.json with content like this:   { "model": { "type": "minecraft:model", "model": "modname:item/itemname" } }  
  • Topics

×
×
  • Create New...

Important Information

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