Jump to content

Recommended Posts

Posted

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()
}

 

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

    • I see. I'm sure I tried again with a lower case word, a few times. I ended up doing the same thing as pixxy in the end. Is this beyond the scope of the admins to fix? Are they already aware of it, or should I use 'contact us' to post a ticket?
    • I’m working on a Manta Ray entity in MCreator using GeckoLib animations, and my goal is to have a looping (flip) animation that ends at −360°, then transitions seamlessly into a swim animation starting at 0°. However, every method I’ve tried—like quickly interpolating the angle, inserting a brief keyframe at 0°, or using a micro “bridge” animation—still causes a visible “flash” https://imgur.com/a/5ucjUb9 or "jump" when the rotation resets. I want a perfectly smooth motion from the flip’s final rotation to the swim’s initial rotation. If anyone has solved this in MCreator/GeckoLib, or found a better trick for handling the −360° →0° gap without a snap, I’d appreciate some advice ! P.S.- I cannot set swim to start at -360 because I would have the same issue but in reverse. Here's the custom LoopingAnimationGoal :   class LoopingAnimationGoal extends Goal { private final MantaRayEntity entity; private final int cooldownTime; private int animationTimer; private int cooldownTimer; // New boolean to prevent double calls private boolean isLoopingActive = false; public LoopingAnimationGoal(MantaRayEntity entity, int cooldownTime) { this.entity = entity; this.cooldownTime = cooldownTime; this.animationTimer = 0; this.cooldownTimer = 0; this.setFlags(EnumSet.of(Flag.MOVE, Flag.LOOK)); } @Override public boolean canUse() { System.out.println("[DEBUG] LoopingGoal canUse => cooldownTimer=" + cooldownTimer); if (cooldownTimer > 0) { cooldownTimer--; return false; } BlockPos entityPos = entity.blockPosition(); boolean canUse = entity.isWaterAbove(entityPos, 4); System.out.println("[DEBUG] LoopingGoal canUse => WATER " + (canUse ? "DETECTED" : "NOT DETECTED") + " at " + entityPos + ", returning " + canUse); return canUse; } @Override public void start() { entity.setAnimation("looping"); animationTimer = 63; isLoopingActive = true; System.out.println("[DEBUG] Looping animation STARTED. Timer=" + animationTimer + ", gameTime=" + entity.level().getGameTime()); } @Override public boolean canContinueToUse() { System.out.println("[DEBUG] LoopingGoal canContinueToUse => animationTimer=" + animationTimer); return animationTimer > 0; } @Override public void tick() { animationTimer--; System.out.println("[DEBUG] LoopingGoal TICK => animationTimer=" + animationTimer); // We stop ONLY if we are still looping if (animationTimer <= 0 && isLoopingActive) { System.out.println("[DEBUG] condition => animationTimer <= 0 && isLoopingActive"); stop(); } } @Override public void stop() { // Check if already stopped if (!isLoopingActive) { System.out.println("[DEBUG] stop() called again, but isLoopingActive = false. Doing nothing."); return; } System.out.println("[DEBUG] Looping STOP at tick=" + entity.level().getGameTime() + ", last known rotation=" + entity.getXRot() + "/" + entity.getYRot() + ", animationTimer=" + animationTimer); // Immediately switch to "swim" entity.setAnimation("swim"); // Reset cooldown cooldownTimer = cooldownTime; // Disable looping to prevent a second stop isLoopingActive = false; System.out.println("[DEBUG] Looping STOP => setAnimation('swim'), cooldownTimer=" + cooldownTimer); } }  
    • So is the intention of the crusher for ores meant to be used with a silk touch pickaxe or something? Cause that seems like too much effort just to profit off of the machine, when everything drops as raw materials now. Am I just missing something? 
  • Topics

×
×
  • Create New...

Important Information

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