Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/llamalad7/mixinextras

Companion library to SpongePowered Mixin with many custom injectors for a more expressive experience.
https://github.com/llamalad7/mixinextras

bytecode-manipulation java mixin

Last synced: 6 days ago
JSON representation

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

Awesome Lists containing this project

README

        

# MixinExtras

[![](https://dcbadge.vercel.app/api/server/VUkAeRYqdH)](https://llama.is-a.dev/discord)

A small companion library to [Mixin](https://github.com/SpongePowered/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](https://github.com/LlamaLad7/MixinExtras/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:

```gradle
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:

```gradle
dependencies {
implementation(jarJar("io.github.llamalad7:mixinextras-neoforge:0.4.1")) {
jarJar.ranged(it, "[0.4.1,)")
}
}
```

Forge 1.18.2+ with ForgeGradle

```gradle
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

```gradle
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.

```gradle
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

```java
MixinExtrasBootstrap.init();
```

somewhere suitably early. In almost all cases I would recommend making
an [IMixinConfigPlugin](https://github.com/SpongePowered/Mixin/blob/master/src/main/java/org/spongepowered/asm/mixin/extensibility/IMixinConfigPlugin.java)
and initializing MixinExtras in its `onLoad` method.

### You're good to go!

Enjoy using the library, and don't hesitate to open an [issue](https://github.com/LlamaLad7/MixinExtras/issues) if you
have any feedback, questions or suggestions.

## Acknowledgements

I use [YourKit's Java profiler](https://www.yourkit.com/java/profiler/) when working on MixinExtras. Many thanks to them
for providing a free license for the project.