MixinExtras Save

Companion library to SpongePowered Mixin with many custom injectors for a more expressive experience.

Project README

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

MixinExtras is available on Maven Central.

The setup steps vary based on your platform:

Fabric / Quilt

FabricLoader 0.15.0+ includes MixinExtras already. If you want to maintain compatibility with older versions, or want to use a different version than is provided, see below:

dependencies {
    include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.2.2")))
}
NeoForge with NeoGradle

NeoForge 20.2.84+ includes MixinExtras already. If you want to maintain compatibility with older versions, or want to use a different version than is provided, see below:

dependencies {
    implementation(jarJar("io.github.llamalad7:mixinextras-neoforge:0.3.5")) {
        jarJar.ranged(it, "[0.3.5,)")
    }
}
Forge 1.18.2+ with ForgeGradle
dependencies {
    compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.3.5"))
    implementation(jarJar("io.github.llamalad7:mixinextras-forge:0.3.5")) {
        jarJar.ranged(it, "[0.3.5,)")
    }
}
Forge 1.18.2+ with Architectury Loom
dependencies {
    compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.3.5"))
    implementation(include("io.github.llamalad7:mixinextras-forge:0.3.5"))
}
Any other platform

This is only a rough guide. You will need to look into the specifics of setting up ShadowJar for your platform.

plugins {
    id "com.github.johnrengelman.shadow" version "8.1.0"
}

configurations {
    implementation.extendsFrom shadow
}

dependencies {
    shadow(annotationProcessor("io.github.llamalad7:mixinextras-common:0.3.5"))
}

shadowJar {
    configurations = [project.configurations.shadow]
    relocate("com.llamalad7.mixinextras", "your.package.goes.here.mixinextras")
    mergeServiceFiles() // Very important!
}

To initialize MixinExtras, simply call

MixinExtrasBootstrap.init();

somewhere suitably early. In almost all cases I would recommend making an IMixinConfigPlugin and initializing MixinExtras in its onLoad method.

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.

Acknowledgements

I use YourKit's Java profiler when working on MixinExtras. Many thanks to them for providing a free license for the project.

Open Source Agenda is not affiliated with "MixinExtras" Project. README Source: LlamaLad7/MixinExtras
Stars
257
Open Issues
3
Last Commit
2 weeks ago
License

Open Source Agenda Badge

Open Source Agenda Rating