Bawnorton / MixinSquared

Mixin library for mixin'ing into other mod's mixins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MixinSquared Logo 2

A Mixin library for mixin'ing into other mod's mixins.

See the wiki for usage

Works with MixinExtras

Gradle

repositories {
    maven { url = "https://jitpack.io" }
}

For each platform:

Fabric / Quilt
dependencies {
    include(implementation(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-fabric:0.1.2-beta.5")))
}
Forge 1.18.2+ with ForgeGradle

This will not work for Forge 1.18.1 and below, see Any Other Platform

dependencies {
    // MixinSquared's annotationProcessor MUST be registered BEFORE Mixin's one.
    implementation(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-common:0.1.2-beta.5"))
    implementation(jarJar("com.github.bawnorton.mixinsquared:mixinsquared-forge:0.1.2-beta.5")) {
        jarJar.ranged(it, "[0.1.2-beta.5,)")
    }
}
NeoForge with NeoGradle
dependencies {
    // MixinSquared's annotationProcessor MUST be registered BEFORE Mixin's one.
    implementation(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-common:0.1.2-beta.5"))
    implementation(jarJar("com.github.bawnorton.mixinsquared:mixinsquared-neoforge:0.1.2-beta.5")) {
        jarJar.ranged(it, "[0.1.2-beta.5,)")
    }
}
Forge 1.18.2+ with Architectury Loom

This will not work for Forge 1.18.1 and below, see Any Other Platform

dependencies {
    implementation(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-common:0.1.2-beta.5"))
    implementation(include("com.github.bawnorton.mixinsquared:mixinsquared-forge:0.1.2-beta.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
}

repositories {
    maven { url = "https://jitpack.io" }
}

dependencies {
    shadow(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-common:0.1.2-beta.5"))
}

shadowJar {
    configurations = [project.configurations.shadow]
    relocate("com.github.bawnorton.mixinsquared", "your.package.goes.here.mixinsquared")
    mergeServiceFiles()
}

To initialize MixinSquared, simply call

MixinSquaredBootstrap.init();

In the onLoad method inside a IMixinConfigPlugin

If you intend to use a MixinCanceller, you will need to also call:

MixinCancellerRegistrar.register(new YourMixinCancellerImpl());

Credits

Massive thanks to LlamaLad7 for providing insight and feedback on this library.

About

Mixin library for mixin'ing into other mod's mixins

License:MIT License


Languages

Language:Java 100.0%