diff --git a/module-mixin/build.gradle b/module-mixin/build.gradle index d9ce71b..bd08d14 100644 --- a/module-mixin/build.gradle +++ b/module-mixin/build.gradle @@ -31,14 +31,24 @@ apply plugin: "com.github.johnrengelman.shadow" // Fabric / SpongePowered / UniMix / GTNH if (mixinFlavor == "fabric" || mixinFlavor == "unimix") { + def uniLocal = mixinFlavor == "unimix" && project.hasProperty("local") + def uniJitpack = mixinFlavor == "unimix" && !uniLocal + mixinVersion = mixinFlavor == "fabric" ? "0.11.4+mixin.0.8.5" : "0.11.6+mixin.0.8.5" - if (mixinFlavor == "unimix" && project.hasProperty("local")) { + if (uniLocal) { mixinVersion += "-local" } - def mixinGroup = mixinFlavor == "fabric" ? "net.fabricmc" : "com.github.legacymoddingmc" - // For some reason, jitpack doesn't work if I have a + in the version string, - // so UniMix doesn't actually have the +mixin.0.8.5 suffix in the maven version. - def mixinDep = mixinFlavor == "fabric" ? "net.fabricmc:sponge-mixin:$mixinVersion" : "com.github.LegacyModdingMC:UniMix:${mixinVersion.split("\\+")[0]}" + + // jitpack differences: + // - domain is com instead of io (for some strange reason) + // - we have to use _ instead of + in version string because the latter is not supported (for some strange reason) + // - artifact id is UniMix, not sponge-mixin (this one makes sense at least) + + def mixinGroup = mixinFlavor == "fabric" ? "net.fabricmc" : "${uniJitpack ? 'com' : 'io'}.github.legacymoddingmc" + def mixinArtifactId = uniJitpack ? "UniMix" : "sponge-mixin" + def mixinDepVersion = uniJitpack ? mixinVersion.replace('+', '_') : mixinVersion + def mixinDep = "$mixinGroup:$mixinArtifactId:$mixinDepVersion" + mixinFlavorClassifier = "$mixinFlavor-$mixinVersion" dependencies {