Jump to content

Curse maven dependencies not showing up as External Library


Drai

Recommended Posts

Hello, I am trying to add a couple of mods as external libraries, but for some reason theyre not showing up as such. I added them as dependencies in my build.gradle, and if I am understanding it correctly that should be sufficient, right?

Could someone take a look and tell me if I am missing anything?

buildscript {
    repositories {
        maven { url = 'https://files.minecraftforge.net/maven' }
        maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
        maven { url = 'https://files.minecraftforge.net/maven' }
        maven { url = 'https://repo.spongepowered.org/maven' }
        maven { url = 'https://maven.parchmentmc.org' }
        mavenCentral()
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: "${project.forgegradle_version}", changing: true
        classpath "org.spongepowered:mixingradle:${project.mixingradle_version}"
        classpath "org.parchmentmc:librarian:${project.librarian_version}"
    }
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

apply plugin: 'org.parchmentmc.librarian.forgegradle'
apply plugin: 'org.spongepowered.mixin'
apply from: 'https://raw.githubusercontent.com/SizableShrimp/Forge-Class-Remapper/main/classremapper.gradle'

mixin {
    add sourceSets.main, "${project.mod_id}.refmap.json"
}


archivesBaseName = project.mod_id
version = "${project.minecraft_version}-${project.mod_version}".toString()
group = "${project.maven_group}.${archivesBaseName}".toString()

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '17' // Need this here so eclipse task generates correctly.

println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {

    if(project.parchment_enabled == "true"){
        mappings channel: 'parchment', version: "${project.parchment_version}-${project.minecraft_version}"
    }else{
        mappings channel: 'official', version: "${project.minecraft_version}"
    }

    accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

    runs {
        client {

            property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
            property 'mixin.env.remapRefMap', 'true'
            arg "-mixin.config=${project.mod_id}.mixins.json".toString()

            jvmArg '-Xmx7G'

            workingDirectory project.file('run')

            // Recommendedo logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'
        }

        server {

            property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
            property 'mixin.env.remapRefMap', 'true'
            arg "-mixin.config=${project.mod_id}.mixins.json".toString()

            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'
        }

        data {

            property 'mixin.env.remapRefMap', 'true'
            property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"

            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'

            args '--mod', "${project.mod_id}", '--all', '--output', file('src/generated/resources/'), '--existing', sourceSets.main.resources.srcDirs[0]   //args "--mod", "usefulbackpacks", "--all", "--output", "\"" + file("src/generated/resources").toString() + "\"", "--validate", "--existing", "\"" + sourceSets.main.resources.srcDirs[0] + "\""

        }
    }
}


// Example for how to get properties into the manifest for reading by the runtime..
jar {
    manifest {
        attributes([
                "Specification-Title": "${projectDir}",
                "Specification-Version": "1", // We are version 1 of ourselves
                "Implementation-Title": project.name,
                "Implementation-Version": "${version}",
                'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
                "MixinConfigs": "${project.mod_id}.mixins.json"
        ])
    }
}

// Example configuration to allow publishing using the maven-publish task
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')

publishing {
    publications {
        mavenJava(MavenPublication) {
            artifact jar
        }
    }
    repositories {
        maven {
            url "file:///${project.projectDir}/mcmodsrepo"
            allowInsecureProtocol = true
        }
    }
}

dependencies {

    minecraft "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}"

    implementation fg.deobf("curse.maven:flywheel-486392:3737402")
    implementation fg.deobf("curse.maven:farmersdelight-398521:3739914")
    implementation fg.deobf("curse.maven:jei-238222:3682513")
    implementation fg.deobf("curse.maven:quark-243121:3800462")
    implementation fg.deobf("curse.maven:autoreglib-250363:3642382")
    implementation fg.deobf("curse.maven:backpacked-352835:3755666")
    implementation fg.deobf("curse.maven:configured-457570:3640884")
    implementation fg.deobf("curse.maven:create-328085:3737418")
    implementation fg.deobf("curse.maven:crimson-nbt-tags-445260:3670163")
    implementation fg.deobf("curse.maven:twigs-496913:3756844")
    implementation fg.deobf("curse.maven:another-furniture-610492:3823382")
    implementation fg.deobf("curse.maven:macaws-bridges-351725:3793697")
    implementation fg.deobf("curse.maven:macaws-doors-378646:3683708")
    implementation fg.deobf("curse.maven:macaws-fences-and-walls-453925:3817472")
    implementation fg.deobf("curse.maven:macaws-lights-and-lamps-502372:3683040")
    implementation fg.deobf("curse.maven:macaws-paths-and-pavings-629153:3810627")
    implementation fg.deobf("curse.maven:macaws-trapdoors-400933:3682901")
    implementation fg.deobf("curse.maven:macaws-windows-363569:3712019")
    implementation fg.deobf("curse.maven:mrcrayfish-furniture-mod-55438:3683524")
    implementation fg.deobf("curse.maven:malum-484064:3768401")
    implementation fg.deobf("curse.maven:ortuslib-616457:3768197")
    implementation fg.deobf("curse.maven:marg-324494:3723497")
    implementation fg.deobf("curse.maven:project-brazier-238326:3723511")
    implementation fg.deobf("curse.maven:curios-309927:3670447")
    implementation fg.deobf("curse.maven:selene-499980:3828175")
    implementation fg.deobf("curse.maven:storage-drawers-223852:3807626")
    implementation fg.deobf("curse.maven:texture-dump-319039:3573998")
    implementation fg.deobf("curse.maven:valhelsia-structures-347488:3708292")
    implementation fg.deobf("curse.maven:decorativeblocks-362528:3681919")
    implementation fg.deobf("curse.maven:apple-crates-630726:3828943")


    annotationProcessor "org.spongepowered:mixin:${project.mixin_version}:processor"
}

repositories {
    maven {
        url = "https://www.cursemaven.com"
        allowInsecureProtocol = true
    }
}

// Loads files in the format {modid}-{version}.jar, MC version optional but picky about hyphens.
// See the regex pattern.
def getModVersion(filename) {
    // println(filename);
    def pattern = /^(?<modid>[^-]+)(?:-(?<mcversion>[0-9.]+))?(?:-(?<modver>[0-9.\-]+))\.jar$/;

    def matcher = filename =~ pattern

    def found = matcher.find()

    if(found) {
        def mod = matcher.group("modid");

        // Extract MC version or default
        def mcVersion = matcher.group("mcversion");

        // Extract mod version
        def version = matcher.group("modver");

        // println("> mod: ${mod}; mc: ${mcVersion}; version: ${version}");

        if(mcVersion == null)
            return "${mod}:${mod}:${version}";
        else
            return "${mod}:${mod}-${mcVersion}:${version}";

    } else {
        println(" > not a mod filename")
        return filename;
    }
}

def dev_mods_dir = "mods"

def dev_mods = fileTree(dev_mods_dir).filter { it -> it.isFile() }.files.name.collect( { getModVersion(it) } )

// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }


dependencies{
    // Deobfuscate each dev mod for runtime
    dev_mods.each {
        compileOnly fg.deobf(it)
        runtimeOnly fg.deobf(it)
    }

    implementation 'org.jetbrains:annotations:22.0.0'
}

repositories{
    // Built mods
    flatDir {
        dirs dev_mods_dir
    }
    mavenCentral()
}

 

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.