MixinExtras
MixinExtras copied to clipboard
Companion library to SpongePowered Mixin with many custom injectors for a more expressive experience.
MixinExtras
A small companion library to Mixin, designed to help you write your Mixins in a more expressive and compatible way.
More information about each feature offered can be found at the Wiki.
Setup
For the time being, I recommend depending on this library via JitPack. After adding its repository to your build script, you can depend on it like so
dependencies {
implementation("com.github.LlamaLad7:MixinExtras:0.0.12")
annotationProcessor("com.github.LlamaLad7:MixinExtras:0.0.12")
}
It is essential that you register MixinExtras as an annotation processor if you want remapping of custom features to work. If you are registering Mixin as an annotation processor too, you must register the MixinExtras annotation processor before the Mixin one.
Bundling MixinExtras
If you intend to use this library in your mod, you will probably need to bundle it in your jar.
If you are on Fabric, I recommend using the include
configuration in your dependencies
block.
If you are on another platform, I recommend the Shadow Gradle Plugin. I also highly recommend you relocate MixinExtras to avoid conflicts with different versions of the library.
Initialization
The final step after setting up your build script is to initialize MixinExtras. To do this, simply call
MixinExtrasBootstrap.init();
somewhere suitably early in your program. On Fabric, this would be a PreLaunch
entrypoint. If you cannot find a
suitable place for your platform, you might like to use
an IMixinConfigPlugin
. Initializing MixinExtras in your plugin's onLoad
method should work fine on any platform.
You're good to go!
Enjoy using the library, and don't hesitate to open an issue if you have any feedback, questions or suggestions.