Fix mixin version detection on NeoForge

This commit is contained in:
Juuz
2023-10-31 19:52:19 +02:00
parent 170e194e1e
commit 53f82da7ff

View File

@@ -75,7 +75,16 @@ public class ForgeLibrariesProvider {
if (lib.getAsString().contains("0.8.2")) {
dep = "net.fabricmc:sponge-mixin:0.8.2+build.24";
} else {
dep = "dev.architectury:mixin-patched" + lib.getAsString().substring(lib.getAsString().lastIndexOf(":")) + ".+";
String version = lib.getAsString().substring(lib.getAsString().lastIndexOf(":"));
// Used for the file extension, for example @jar
int atIndex = version.indexOf('@');
if (atIndex >= 0) {
// Strip the file extension away
version = version.substring(0, atIndex);
}
dep = "dev.architectury:mixin-patched" + version + ".+";
}
}
}