CleanMix is a fork of Fabric Mixin which is a more cutting-edge fork of SpongePowered Mixin.
CleanMix aims to target more specifically 1.12.2 environments, for Forge (with MixinBooter) and Cleanroom natively.
Mixin itself is a trait/mixin framework for Java using ASM and hooking into the runtime classloading process via a set of pluggable built-in or user-provided services.
The main documentation for Mixin can be found in the Wiki.
Additional documentation for individual features and annotations can be found in
the extensive Javadoc. For
additional help, feel free to ask on the #general-dev
channel on the CleanroomMC Discord.
CleanMix will be available via Maven soon:
- https://repo.cleanroommc.com/#/releases - Viewable repository
- https://maven.cleanroommc.com - Maven endpoint
For handling obfuscation tasks, Mixin provides an Annotation Processor
which works at compile time to generate obfuscation mappings for your toolchain
to apply. If using Gradle 5 or later, annotation processors are no longer
automatically loaded from compile
configurations and must be specified
explicitly via annotationProcessor
configurations. For this purpose, Mixin
provides "fat jar" artefacts containing all required dependencies via the
:processor
classifier. For example if your build uses the dependency
com.cleanroommc:cleanmix:1.2.3
then your annotationProcessor configuration
should specify dependency com.cleanroommc:cleanmix:1.2.3:processor
.
When developing using Mixin, you can use the Mixin Annotation Processor within Eclipse to provide context-sensitive errors and warnings to help you more easily troubleshoot your mixins. To do so:
- Run the
gradle build
command to generate the mixin jar - Open the properties of your eclipse project and navigate to
Java Compiler
->Annotation Processing
->Factory Path
- Check the
Enable project specific settings
checkbox - Click the
Add External JARs
button and select the generated mixin jar with the suffix -processor (hint: it should be inMixin/build/libs
) - Navigate up one level to
Java Compiler
->Annotation Processing
- Check the
Enable project specific settings
checkbox - Check the
Enable annotation processing
checkbox - Click the
New...
button next to theProcessor options
box
- Set
Key
to reobfSrgFile - Set
Value
to the fully-qualified path to themcp-srg.srg
file (the location of the mapping file varies by platform, if you are unsure where to find it please follow the discord link below).
- Click
OK
to apply the changes
Enhanced functionality for working with Mixin in IntelliJ IDEA is available via the Minecraft Development for IntelliJ IDEA plugin developed by DemonWav.