Fix for 1.18-pre1 server bundler.

In the bundler its called 1.18 Pre-release 1 not 1.18-pre1, so we just assume there is only ever going to be 1 version per jar.
dev/0.11
modmuss50 2021-11-11 18:28:15 +00:00
parent e2b4bc8985
commit 2994c2d488
2 changed files with 11 additions and 7 deletions

View File

@ -281,8 +281,13 @@ public class MinecraftProviderImpl extends DependencyProvider implements Minecra
} }
String jarPath = null; String jarPath = null;
String[] versions = versionsList.split("\n");
for (String version : versionsList.split("\n")) { if (versions.length != 1) {
throw new UnsupportedOperationException("Expected only 1 version in META-INF/versions.list, but got %d".formatted(versions.length));
}
for (String version : versions) {
if (version.isBlank()) continue; if (version.isBlank()) continue;
String[] split = version.split("\t"); String[] split = version.split("\t");
@ -293,10 +298,9 @@ public class MinecraftProviderImpl extends DependencyProvider implements Minecra
final String id = split[1]; final String id = split[1];
final String path = split[2]; final String path = split[2];
if (minecraftVersion().equals(id)) { // Take the first (only) version we find.
jarPath = path; jarPath = path;
break; break;
}
} }
Objects.requireNonNull(jarPath, "Could not find minecraft server jar for " + minecraftVersion()); Objects.requireNonNull(jarPath, "Could not find minecraft server jar for " + minecraftVersion());

View File

@ -1,7 +1,7 @@
org.gradle.jvmargs=-Xmx1G org.gradle.jvmargs=-Xmx1G
minecraft_version=21w44a minecraft_version=1.18-pre1
yarn_mappings=21w44a+build.8 yarn_mappings=1.18-pre1+build.2
loader_version=0.12.5 loader_version=0.12.5
fabric_version=0.42.1+1.18 fabric_version=0.42.1+1.18