Compare commits
7 Commits
f47686a9de
...
ef3836a16d
Author | SHA1 | Date |
---|---|---|
microwin7 | ef3836a16d | |
Gravita | 748612783c | |
Gravita | 42cf9bc79e | |
Gravita | 8a81989d65 | |
Gravita | 58fd3a7e8b | |
Gravita | cc6ed82afb | |
microwin7 | 0e1691ee4c |
|
@ -31,6 +31,9 @@ public class MakeProfileHelper {
|
|||
builder.setUpdateVerify(List.of("libraries", "natives", "mods", "minecraft.jar", "forge.jar", "liteloader.jar"));
|
||||
{
|
||||
List<String> classPath = new ArrayList<>(5);
|
||||
if(findOption(options, MakeProfileOptionLaunchWrapper.class).isPresent()) {
|
||||
classPath.add("libraries/net/minecraft/launchwrapper/1.12/launchwrapper-1.12.jar");
|
||||
}
|
||||
classPath.add("libraries");
|
||||
classPath.add("minecraft.jar");
|
||||
if (version.compareTo(ClientProfileVersions.MINECRAFT_1_12_2) <= 0) {
|
||||
|
|
|
@ -147,7 +147,7 @@ public class ClientLauncherProcess {
|
|||
if (params.profile.getClassLoaderConfig() == ClientProfile.ClassLoaderConfig.AGENT) {
|
||||
processArgs.add("-javaagent:".concat(IOHelper.getCodeSource(ClientLauncherEntryPoint.class).toAbsolutePath().toString()));
|
||||
} else if (params.profile.getClassLoaderConfig() == ClientProfile.ClassLoaderConfig.SYSTEM_ARGS) {
|
||||
systemClassPath.addAll(ClientLauncherEntryPoint.resolveClassPath(workDir, params.actions, params.profile)
|
||||
systemClassPath.addAll(ClientLauncherEntryPoint.resolveClassPath(new HashSet<>(), workDir, params.actions, params.profile)
|
||||
.filter(x -> !params.profile.getModulePath().contains(workDir.relativize(x).toString()))
|
||||
.map(Path::toString)
|
||||
.toList());
|
||||
|
|
|
@ -118,7 +118,8 @@ public class ClientLauncherEntryPoint {
|
|||
|
||||
// Verify ClientLauncher sign and classpath
|
||||
LogHelper.debug("Verifying ClientLauncher sign and classpath");
|
||||
List<Path> classpath = resolveClassPath(clientDir, params.actions, params.profile)
|
||||
Set<Path> ignoredPath = new HashSet<>();
|
||||
List<Path> classpath = resolveClassPath(ignoredPath, clientDir, params.actions, params.profile)
|
||||
.filter(x -> !profile.getModulePath().contains(clientDir.relativize(x).toString()))
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
if(LogHelper.isDevEnabled()) {
|
||||
|
@ -252,11 +253,11 @@ public class ClientLauncherEntryPoint {
|
|||
}
|
||||
}
|
||||
|
||||
private static LinkedList<Path> resolveClassPathList(Path clientDir, String... classPath) throws IOException {
|
||||
return resolveClassPathStream(clientDir, classPath).collect(Collectors.toCollection(LinkedList::new));
|
||||
private static LinkedList<Path> resolveClassPathList(Set<Path> ignorePaths, Path clientDir, String... classPath) throws IOException {
|
||||
return resolveClassPathStream(ignorePaths, clientDir, classPath).collect(Collectors.toCollection(LinkedList::new));
|
||||
}
|
||||
|
||||
private static Stream<Path> resolveClassPathStream(Path clientDir, String... classPath) throws IOException {
|
||||
private static Stream<Path> resolveClassPathStream(Set<Path> ignorePaths, Path clientDir, String... classPath) throws IOException {
|
||||
Stream.Builder<Path> builder = Stream.builder();
|
||||
for (String classPathEntry : classPath) {
|
||||
Path path = clientDir.resolve(IOHelper.toPath(classPathEntry.replace(IOHelper.CROSS_SEPARATOR, IOHelper.PLATFORM_SEPARATOR)));
|
||||
|
@ -265,20 +266,28 @@ public class ClientLauncherEntryPoint {
|
|||
IOHelper.walk(path, new ClassPathFileVisitor(jars), false);
|
||||
Collections.sort(jars);
|
||||
for(var e : jars) {
|
||||
if(ignorePaths.contains(e)) {
|
||||
continue;
|
||||
}
|
||||
builder.accept(e);
|
||||
ignorePaths.add(e);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if(ignorePaths.contains(path)) {
|
||||
continue;
|
||||
}
|
||||
builder.accept(path);
|
||||
ignorePaths.add(path);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
public static Stream<Path> resolveClassPath(Path clientDir, Set<OptionalAction> actions, ClientProfile profile) throws IOException {
|
||||
Stream<Path> result = resolveClassPathStream(clientDir, profile.getClassPath());
|
||||
public static Stream<Path> resolveClassPath(Set<Path> ignorePaths, Path clientDir, Set<OptionalAction> actions, ClientProfile profile) throws IOException {
|
||||
Stream<Path> result = resolveClassPathStream(ignorePaths, clientDir, profile.getClassPath());
|
||||
for (OptionalAction a : actions) {
|
||||
if (a instanceof OptionalActionClassPath)
|
||||
result = Stream.concat(result, resolveClassPathStream(clientDir, ((OptionalActionClassPath) a).args));
|
||||
result = Stream.concat(result, resolveClassPathStream(ignorePaths, clientDir, ((OptionalActionClassPath) a).args));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -340,8 +349,9 @@ public class ClientLauncherEntryPoint {
|
|||
|
||||
@Override
|
||||
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
|
||||
if (IOHelper.hasExtension(file, "jar") || IOHelper.hasExtension(file, "zip"))
|
||||
if (IOHelper.hasExtension(file, "jar") || IOHelper.hasExtension(file, "zip")) {
|
||||
result.add(file);
|
||||
}
|
||||
return super.visitFile(file, attrs);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ public final class Version implements Comparable<Version> {
|
|||
public static final int MINOR = 6;
|
||||
public static final int PATCH = 1;
|
||||
public static final int BUILD = 1;
|
||||
public static final Version.Type RELEASE = Type.DEV;
|
||||
public static final Version.Type RELEASE = Type.STABLE;
|
||||
public final int major;
|
||||
public final int minor;
|
||||
public final int patch;
|
||||
|
|
|
@ -93,6 +93,7 @@ public class JavaHelper {
|
|||
trySearchJava(javaPaths, result, rootDrive.resolve("Program Files").resolve("Java"));
|
||||
trySearchJava(javaPaths, result, rootDrive.resolve("Program Files").resolve("AdoptOpenJDK"));
|
||||
trySearchJava(javaPaths, result, rootDrive.resolve("Program Files").resolve("Eclipse Foundation")); //AdoptJDK rebranding
|
||||
trySearchJava(javaPaths, result, rootDrive.resolve("Program Files").resolve("Eclipse Adoptium")); //AdoptJDK rebranding
|
||||
trySearchJava(javaPaths, result, rootDrive.resolve("Program Files").resolve("BellSoft")); // LibericaJDK
|
||||
} catch (IOException e) {
|
||||
LogHelper.error(e);
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
# Modification of the launcher sashok724's v3 from Gravit [![Build Status](https://travis-ci.com/GravitLauncher/Launcher.svg?branch=master)](https://travis-ci.com/GravitLauncher/Launcher)
|
||||
# Modification of the launcher sashok724's v3 from Gravit
|
||||
[![Build Status](https://travis-ci.com/GravitLauncher/Launcher.svg?branch=master)](https://travis-ci.com/GravitLauncher/Launcher)
|
||||
[![Join our Discord](https://img.shields.io/discord/853340557522370561.svg?logo=discord&label=)](https://discord.gg/b9QG4ygY75)
|
||||
|
||||
* [Discord channel](https://discord.gg/b9QG4ygY75)
|
||||
|
||||
|
@ -9,4 +11,4 @@
|
|||
|
||||
```sh
|
||||
curl -s https://raw.githubusercontent.com/GravitLauncher/Launcher/master/get_it.sh | sh
|
||||
```
|
||||
```
|
||||
|
|
|
@ -5,7 +5,7 @@ plugins {
|
|||
id 'org.openjfx.javafxplugin' version '0.1.0' apply false
|
||||
}
|
||||
group = 'pro.gravit.launcher'
|
||||
version = '5.6.0'
|
||||
version = '5.6.1'
|
||||
|
||||
apply from: 'props.gradle'
|
||||
|
||||
|
|
Loading…
Reference in New Issue