### [![Build Status](http://ci.liteloader.com/view/Other/job/Mixin/badge/icon)](http://ci.liteloader.com/view/Other/job/Mixin/lastSuccessfulBuild/) ![Mixin Logo](docs/logo.png?raw=true) **Mixin** is a trait/mixin framework for Java using [ASM](http://asm.ow2.org/) and hooking into the runtime class-loading process via Mojang's [LegacyLauncher](https://github.com/Mojang/LegacyLauncher) system. The main documentation for **Mixin** can be found in the [Wiki](../../wiki). Additional documentation for individual features and annotations can be found in the extensive [Javadoc](http://jenkins.liteloader.com/job/Mixin/javadoc/). For additional help use the channel `#spongedev` on the Espernet IRC network. ### Building Mixin **Mixin** uses the [Gradle](http://gradle.org/) build automation system. To perform a build, use gradle version 2.11 and execute gradle from within the project root directory. *(If you do not have Gradle installed on your system you can instead run the supplied Gradle wrapper `gradlew`)* ### Integration with Eclipse IDE The **Mixin** project can be integrated easily with Eclipse using the [Gradle Plugin](http://marketplace.eclipse.org/content/gradle-integration-eclipse-44). Simply choose `Import` -> `Gradle Project` and follow the prompts. 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: 1. Run the `gradle build` command to generate the mixin jar 2. Open the properties of your eclipse project and navigate to `Java Compiler` -> `Annotation Processing` -> `Factory Path` 3. Check the `Enable project specific settings` checkbox 4. Click the `Add External JARs` button and select the generated mixin jar with the suffix **-processor** (hint: it should be in `Mixin/build/libs`) 5. Navigate up one level to `Java Compiler` -> `Annotation Processing` 6. Check the `Enable project specific settings` checkbox 7. Check the `Enable annotation processing` checkbox 8. Click the `New...` button next to the `Processor options` box * Set `Key` to **reobfSrgFile** * Set `Value` to the fully-qualified path to the `mcp-srg.srg` file (for Sponge this can be found in `Sponge/build/srgs/mcp-srg.srg`) 9. Click `OK` to apply the changes ### Integration with IntelliJ IDEA IDE Enhanced functionality for working with **Mixin** in IntelliJ IDEA is available via the [Minecraft Development for IntelliJ IDEA](https://plugins.jetbrains.com/idea/plugin/8327) plugin developed by [DemonWav](https://github.com/demonwav). ### Version History
Version Features / Changes Date
0.1
  • Basic Mixin Support
  • Basic Injector Support
  • Annotation Processor
January 2015
0.2
  • Added supermixin support (mixins inheriting from other mixins)
March 2015
0.3
  • Implemented Environments
  • Intrinsic method support
  • Enabled local variable capture
  • Alias support
March 2015
0.3.1
  • Annotation Merging
  • Allow Overwrite methods to be aliased
April 2015
0.3.2
  • Error handler support
April 2015
0.4
  • Shade relocated ASM package and use throughout
May 2015
0.4.3
  • Add INVOKE_ASSIGN injection point
  • Support injector callbacks without args
  • Support coercion of covariant parameter types in callbacks
  • Support truncating local-capturing injector handlers
  • Runtime decompilation of exported classes using fernflower
  • Add export filter
May 2015
0.4.4
  • Add constraints for overwrites
July 2015
0.4.6
  • Add INIT phase for handling early FML startup
  • Add support for lambdas in mixins
  • Add support for hot code replacement in mixins
  • Improve Java 8 feature support
September 2015
0.4.8
  • Annotation Processor improved to support MixinGradle
  • Support multiple target obfuscation environments in refmaps
December 2015
0.4.10
  • Runtime remapping support using RemapperChain
  • Ignore class transformers decorated with @Resource
  • Support @reason and @author validation on overwrites
December 2015
0.4.11
  • Add support for injector grouping and config-wide require value
January 2016
0.4.13
  • Add @Final annotation
January 2016
0.4.14
  • Add support for interface mixins
January 2016
0.4.15
  • Include soft targets in refmap
January 2016
0.4.17
  • Support ExtraSRGs in Annotation Processor
  • Include constructors in reference map
  • Add @Mutable annotation to suppress @Final warnings
January 2016
0.4.18
  • Add @ModifyLocal injector
February 2016
0.4.19
  • Add support for @Redirect on fields as well as methods
February 2016
0.5.1
  • Overhaul injectors, injectors from all mixins now scan before any injectors are actually processed. Makes injectors more deterministic.
February 2016
0.5.2
  • Support ID on injectors
  • Support priority for injectors
February 2016
0.5.3
  • Conform injectors
  • Enable hotswapper automatically if agent is active
  • Fix multiple issues with generics in Annotation Processors
February 2016
0.5.4
  • Error handlers also receive mixin prepare errors
April 2016
0.5.5
  • Add @ModifyConstant injector
  • Add @Debug annotation
  • Allow static @ModifyArg handlers in instance methods
April 2016
0.5.6
  • Environment changes, support environment via agents
May 2016
0.5.7
  • Add @Unique annotation
June 2016
0.5.8
  • Support constraints on injectors
June 2016
0.5.9
  • Hard fail if a required mixin target was already transformed
June 2016
0.5.10
  • Support @Unique on fields
June 2016
0.5.13
  • Add alternative strategy for injecting field initialisers
September 2016
0.5.14
  • Add async decompilation support
September 2016
0.5.16
  • Annotation Processor improvements. Support shadows and overrides in multi-target mixins
  • Support pluggable obfuscation environments in AP
October 2016
0.5.17
  • Allow @Redirect injectors to target NEW opcodes for constructor redirection
October 2016
0.6
  • Accessor Mixin support
October 2016
0.6.1
  • Process soft-implements annotations in the AP
November 2016
0.6.2
  • Add support for @Pseudo (virtual target) mixins
December 2016
0.6.3
  • SourceDebugExtension support
December 2016
0.6.4
  • Allow descriptors on NEW injection points
January 2017
0.6.5
  • Add support for injector slices
January 2017
0.6.6
  • Allow static methods in accessor mixins in Java 8 and above
January 2017
0.6.7
  • Add support for @Redirect on array access
January 2017
0.6.8
  • Allow @ModifyConstant to hook implicit zero in comparisons
February 2017