-
Current Mixin Version: CleanMix 0.7.2 by CleanroomMC, a fork of SpongePowered/Fabric Mixin (0.8.7)
-
Current MixinExtra Version: 0.5.5 by CleanroomMC
- Add CleanroomMC's repository and depend on MixinBooter's maven entry:
repositories {
maven {
url ''
}
}
dependencies {
def mixin = 'zone.rong:mixinbooter:11.17'
implementation (mixin) {
transitive = false
}
annotationProcessor mixin
// RetroFuturaGradle for refmap generation:
modUtils.enableMixins(mixin)
// modUtils.enableMixins(mixin, 'mod_id.mixins.refmap.json') << add refmap name as 2nd arg (optional)
}- Pick how to register your mixin configurations. MixinBooter supports lots of approaches:
(As of 11.0, early/late divide is no longer present, therefore IEarly/ILateMixinLoaders are deprecated)
MixinConfigsmanifest attribute: no loader class needed. Add a comma-separated list of your mixin configuration names to your jar's manifest. MixinBooter reads it straight from the jar's manifest and registers them.MixinConnectormanifest attribute: register configs programmatically. Point it at a class implementingorg.spongepowered.asm.mixin.connect.IMixinConnector, itsconnect()is called during boot, where you callMixins.addConfiguration(...)yourself.
Both manifest attributes are set on your jar task:
jar {
manifest {
attributes(
'MixinConfigs': 'mixins.mymod.json',
'MixinConnector': 'com.example.mymod.MyMixinConnector'
)
}
}public class MyMixinConnector implements IMixinConnector {
@Override
public void connect() {
// Check if mod is loaded before registering?
// Possible with zone.rong.mixinbooter.service.ModDiscoverer.isModPresent(String modId)
Mixins.addConfiguration("mixins.mymod.json");
}
}