- 1,308
- 83
- 556
Приветствую! Я только начинаю осваивать работу с миксинами. Подключил к проекту согласно гайду, найденному на просторах форума. Вроде бы всё работает, однако перестаёт запускаться игра из среды разработки - встроенный компилятор выдаёт ошибку. Как вы решали данную проблему?

Настройки проекта:


Настройки проекта:

build.gradle:
plugins {
id 'net.minecraftforge.gradle' version '6.0.+'
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT'
id 'idea'
}
repositories {
mavenLocal()
mavenCentral()
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
maven {
// Su5ed LegacyDev Fork
url = "https://maven.su5ed.dev/releases"
}
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(8)
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
}
legacy {
fixClasspath = true
extractMappings = true
attachMappings = true
}
idea {
module {
inheritOutputDirs = true
excludeDirs += file('run')
}
}
minecraft {
mappings channel: 'stable', version: '39-1.12'
accessTransformer = file('src/main/resources/META-INF/modid_at.cfg')
runs {
configureEach {
workingDirectory file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
environment 'MC_VERSION', '1.12.2'
args '--tweakClass', 'org.spongepowered.asm.launch.MixinTweaker', '--mixin', 'mixins.modid.json'
mods {
"${mod_id}" {
source sourceSets.main
}
}
}
client {}
server {}
}
}
mixin {
add sourceSets.main, 'mixins.modid.refmap.json'
}
sourceSets {
main {
// Include resources generated by data generators
resources { srcDir 'src/generated/resources' }
}
}
dependencies {
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860'
implementation 'org.spongepowered:mixin:0.8.3-SNAPSHOT'
annotationProcessor 'org.spongepowered:mixin:0.8.3-SNAPSHOT:processor'
constraints {
implementation('net.minecraftforge:legacydev:0.3.0.0-legacyExt') {
because 'Needed to have all ATs work properly'
}
implementation('org.ow2.asm:asm-debug-all:5.2') {
because 'Newer ASM versions include module info that causes errors in Java 8'
}
}
configurations.forEach {
// MergeTool pollutes the classpath with conflicting classes
it.exclude(group: 'net.minecraftforge', module: 'mergetool')
// LegacyDev forge dep wants fatjar as the classifier, but 3.0 lacks it
it.resolutionStrategy.eachDependency {
if (it.requested.module.toString() == "net.minecraftforge:legacydev") {
it.artifactSelection {
it.selectArtifact(DependencyArtifact.DEFAULT_TYPE, null, null)
}
}
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
processResources {
// redo task if any of these properties change
inputs.property 'version', project.version
duplicatesStrategy = DuplicatesStrategy.INCLUDE
// Replace properties in all files
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version
}
}
jar {
manifest {
attributes 'FMLCorePluginContainsFMLMod': 'true'
attributes 'FMLAT': 'modid_at.cfg'
attributes 'ForceLoadAsMod': 'true'
attributes 'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker'
attributes 'MixinConfigs': 'mixins.modid.json'
}
}