Skip to content

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

License

Notifications You must be signed in to change notification settings

LlamaLad7/MixinExtras

Repository files navigation

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.4.1")))
}
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.4.1")) {
        jarJar.ranged(it, "[0.4.1,)")
    }
}
Forge 1.18.2+ with ForgeGradle
dependencies {
    compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.4.1"))
    implementation(jarJar("io.github.llamalad7:mixinextras-forge:0.4.1")) {
        jarJar.ranged(it, "[0.4.1,)")
    }
}
Forge 1.18.2+ with Architectury Loom
dependencies {
    compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.4.1"))
    implementation(include("io.github.llamalad7:mixinextras-forge:0.4.1"))
}
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.4.1"))
}

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published