More windows fixes

This commit is contained in:
JFronny 2021-10-31 00:07:44 +02:00
parent bb3063f638
commit cdfdcd12b4
No known key found for this signature in database
GPG Key ID: BEC5ACBBD4EE17E5
2 changed files with 6 additions and 4 deletions

View File

@ -12,6 +12,7 @@ import io.gitlab.jfronny.inceptum.util.api.McApi;
import io.gitlab.jfronny.inceptum.util.api.account.AccountManager;
import io.gitlab.jfronny.inceptum.util.api.account.AuthInfo;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
@ -40,7 +41,7 @@ public class ClientLauncher {
StringBuilder classPath = new StringBuilder();
for (ArtifactInfo artifact : VersionInfoLibraryResolver.getRelevant(info)) {
classPath.append(Inceptum.LIBRARIES_DIR.resolve(artifact.path).toAbsolutePath());
classPath.append(':');
classPath.append(File.pathSeparatorChar);
}
classPath.append(Inceptum.LIBRARIES_DIR.resolve("net/minecraft/client").resolve(version.id + ".jar").toAbsolutePath());
if (info.arguments != null) args.addAll(parse(info.arguments.jvm, info, instance, classPath.toString(), path.toAbsolutePath().toString()));

View File

@ -9,6 +9,7 @@ import io.gitlab.jfronny.inceptum.model.mojang.VersionsListInfo;
import io.gitlab.jfronny.inceptum.util.api.FabricMetaApi;
import io.gitlab.jfronny.inceptum.util.api.McApi;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
@ -40,17 +41,17 @@ public class ServerLauncher {
StringBuilder classPath = new StringBuilder();
for (ArtifactInfo artifact : VersionInfoLibraryResolver.getRelevant(info)) {
classPath.append(Inceptum.LIBRARIES_DIR.resolve(artifact.path).toAbsolutePath());
classPath.append(':');
classPath.append(File.pathSeparatorChar);
}
Path serverJar = instance.isFabric()
? Inceptum.LIBRARIES_DIR.resolve("net/fabricmc/fabric-installer").resolve("fabric-installer-" + FabricMetaApi.getInstallerVersion().version + "-" + version.id + ".jar")
: Inceptum.LIBRARIES_DIR.resolve("net/minecraft/server").resolve(version.id + ".jar");
classPath.append(serverJar.toAbsolutePath()).append(':');
classPath.append(serverJar.toAbsolutePath());
if (instance.minMem != null) args.add("-Xms" + instance.minMem);
if (instance.maxMem != null) args.add("-Xmx" + instance.maxMem);
if (instance.jvmArgsCustom != null) args.addAll(instance.jvmArgsCustom);
args.add("-cp");
args.add(classPath.substring(0, classPath.length() - 1));
args.add(classPath.toString());
String mainClass = null;
final String linePrefix = "Main-Class: ";
try (FileSystem fs = FileSystems.newFileSystem(new URI("jar", serverJar.toUri().toString(), null), new HashMap<>())) {