- 1,560
- 86
- 204
Использую уже встроенные Миксины в Forge. Всё работает в IDEA, но если запускать мод через лаунчер, то не работает, хотя все логи одинаковые. Ошибок нет.
Вот код, который я использую:
Вот код, который я использую:
build.gradle:
minecraft {
mappings channel: 'official', version: '1.16.5'
runs {
client {
workingDirectory project.file('run')
arg "-mixin.config=example.mixins.json"
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
mods {
examplemod {
source sourceSets.main
}
}
}
}
}
....
jar {
manifest {
attributes([
"FMLCorePluginContainsFMLMod": "true",
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
"ForceLoadAsMod": "true",
"MixinConfigs": "example.mixins.json",
"Specification-Title": "examplemod",
"Specification-Vendor": "examplemodsareus",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"examplemodsareus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
example.mixins.json:
{
"required": true,
"package": "example.mixin",
"compatibilityLevel": "JAVA_8",
"refmap": "example.refmap.json",
"minVersion": "0.8",
"mixins": [
"MixinMinecraft"
]
}
Java:
@Mixin(Minecraft.class)
public class MixinMinecraft {
@Inject(at = @At("HEAD"), method = "handleKeybinds()V", cancellable = true)
private void handleKeybinds(CallbackInfo ci) {
// ...
}
}