Jump to content

Recommended Posts

Posted (edited)

I'm having some difficulties getting mixin to work. I feel like I'm following the correct steps and doing the same as other mods. Probably just being stupid and missing something.

After running the command "gradlew genEclipseRuns" I get the following output:
 

FAILURE: Build failed with an exception.

* Where:
1.19.x/build.gradle' line: 5

* What went wrong:
Plugin [id: 'org.spongepowered.mixin', version: '0.7.+'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.spongepowered.mixin:org.spongepowered.mixin.gradle.plugin:0.7.+')
  Searched in the following repositories:
    Gradle Central Plugin Repository
    maven(https://maven.minecraftforge.net/)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s



This is my build.gradle:

plugins {
    id 'eclipse'
    id 'maven-publish'
    id 'net.minecraftforge.gradle' version '5.1.+'
    id "org.spongepowered.mixin" version "0.7.+"
}

version = "1.19.2-$modVersion"
group = 'com.brassamber.modid'
archivesBaseName = 'modid'

java.toolchain.languageVersion = JavaLanguageVersion.of(17)

println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
minecraft {
    mappings channel: 'official', version: '1.19.2'

    // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.

    runs {
        client {
            workingDirectory project.file('run/client')
            arg "-mixin.config=modid.mixins.json"

            property 'forge.logging.markers', 'REGISTRIES'
            property 'forge.logging.console.level', 'debug'
            property 'forge.enabledGameTestNamespaces', 'modid'

            mods {
                modid {
                    source sourceSets.main
                }
            }
        }

        server {
            workingDirectory project.file('run/server')
            arg "-mixin.config=modid.mixins.json"

            property 'forge.logging.markers', 'REGISTRIES'
            property 'forge.logging.console.level', 'debug'
            property 'forge.enabledGameTestNamespaces', 'modid'

            mods {
                modid {
                    source sourceSets.main
                }
            }
        }

        gameTestServer {
            workingDirectory project.file('run/gameTestServer')
            property 'forge.logging.markers', 'REGISTRIES'
            property 'forge.logging.console.level', 'debug'
            property 'forge.enabledGameTestNamespaces', 'modid'

            mods {
                modid {
                    source sourceSets.main
                }
            }
        }

        data {
            workingDirectory project.file('run/data')
            property 'forge.logging.markers', 'REGISTRIES'
            property 'forge.logging.console.level', 'debug'

            // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
            args '--mod', 'modid', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')

            mods {
                modid {
                    source sourceSets.main
                }
            }
        }
    }
}

sourceSets.main.resources { srcDir 'src/generated/resources' }

repositories {
    // Geckolib installation
    maven { url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' }
}

mixin {
    add sourceSets.main, "modid.refmap.json"
}

dependencies {
    minecraft 'net.minecraftforge:forge:1.19.2-43.0.8'
    // Geckolib installation
    implementation fg.deobf('software.bernie.geckolib:geckolib-forge-1.19:3.1.16')

    // Apply Mixin AP
    annotationProcessor 'org.spongepowered:mixin:0.8.5-SNAPSHOT:processor'
}

jar {
    manifest {
        attributes([
                "Specification-Title"     : "modid",
                "Specification-Vendor"    : "BrassAmber",
                "Specification-Version"   : "$modVersion",
                "Implementation-Title"    : "modid",
                "Implementation-Version"  : "$modVersion",
                "Implementation-Vendor"   : "BrassAmber",
                "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
        ])
    }
}

jar.finalizedBy('reobfJar')

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

tasks.withType(JavaCompile).configureEach {
    options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}

This is my modid.mixins.json: (Located in the resources folder)

{
  "required": true,
  "minVersion": "0.8.5",
  "package": "com.brassamber.modid.mixin",
  "refmap": "modid.refmap.json",
  "compatibilityLevel": "JAVA_17",
  "mixins": [
  ],
  "client": [
  ]
}

 

Edited by Xrated_junior
Typo
Posted

This is like walking into a shoe repair shop and asking if they can fix your glasses. 🙂

These are the forge support forums, not mixin.

 

Anyway, you appear to be missing the sponge/mixin maven from your repository configuration:

- Plugin Repositories (could not resolve plugin artifact 'org.spongepowered.mixin:org.spongepowered.mixin.gradle.plugin:0.7.+')
  Searched in the following repositories:
    Gradle Central Plugin Repository
    maven(https://maven.minecraftforge.net/)

e.g. https://github.com/VazkiiMods/Botania/blob/eae067be2c5df0cf89c4e978c3fa2c693580a120/Forge/build.gradle#L5

  • Thanks 1

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Posted

That's what I said.

I answered it because the problem is really a gradle (repository config) issue rather anything mixin specific.

  • Thanks 1

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

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.