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": [
]
}