mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
[REFACTOR] ClientProfileBuilder
This commit is contained in:
parent
8908710ad6
commit
9bd65c797b
10 changed files with 314 additions and 240 deletions
|
@ -5,6 +5,7 @@
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import pro.gravit.launcher.base.Launcher;
|
import pro.gravit.launcher.base.Launcher;
|
||||||
import pro.gravit.launcher.base.profiles.ClientProfile;
|
import pro.gravit.launcher.base.profiles.ClientProfile;
|
||||||
|
import pro.gravit.launcher.base.profiles.ClientProfileBuilder;
|
||||||
import pro.gravit.launcher.base.profiles.ClientProfileVersions;
|
import pro.gravit.launcher.base.profiles.ClientProfileVersions;
|
||||||
import pro.gravit.launchserver.LaunchServer;
|
import pro.gravit.launchserver.LaunchServer;
|
||||||
import pro.gravit.launchserver.command.Command;
|
import pro.gravit.launchserver.command.Command;
|
||||||
|
@ -61,9 +62,11 @@ public void invoke(String... args) throws IOException, CommandException {
|
||||||
try {
|
try {
|
||||||
JsonElement clientJson = server.mirrorManager.jsonRequest(null, "GET", "clients/%s.json", versionName);
|
JsonElement clientJson = server.mirrorManager.jsonRequest(null, "GET", "clients/%s.json", versionName);
|
||||||
clientProfile = Launcher.gsonManager.configGson.fromJson(clientJson, ClientProfile.class);
|
clientProfile = Launcher.gsonManager.configGson.fromJson(clientJson, ClientProfile.class);
|
||||||
clientProfile.setTitle(dirName);
|
var builder = new ClientProfileBuilder(clientProfile);
|
||||||
clientProfile.setDir(dirName);
|
builder.setTitle(dirName);
|
||||||
clientProfile.setUUID(UUID.randomUUID());
|
builder.setDir(dirName);
|
||||||
|
builder.setUuid(UUID.randomUUID());
|
||||||
|
clientProfile = builder.createClientProfile();
|
||||||
if (clientProfile.getServers() != null) {
|
if (clientProfile.getServers() != null) {
|
||||||
ClientProfile.ServerProfile serverProfile = clientProfile.getDefaultServerProfile();
|
ClientProfile.ServerProfile serverProfile = clientProfile.getDefaultServerProfile();
|
||||||
if (serverProfile != null) {
|
if (serverProfile != null) {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import pro.gravit.launcher.base.Launcher;
|
import pro.gravit.launcher.base.Launcher;
|
||||||
import pro.gravit.launcher.base.profiles.ClientProfile;
|
import pro.gravit.launcher.base.profiles.ClientProfile;
|
||||||
|
import pro.gravit.launcher.base.profiles.ClientProfileBuilder;
|
||||||
import pro.gravit.launchserver.LaunchServer;
|
import pro.gravit.launchserver.LaunchServer;
|
||||||
import pro.gravit.launchserver.command.Command;
|
import pro.gravit.launchserver.command.Command;
|
||||||
import pro.gravit.utils.helper.IOHelper;
|
import pro.gravit.utils.helper.IOHelper;
|
||||||
|
@ -44,8 +45,9 @@ public void invoke(String... args) throws Exception {
|
||||||
try(Reader reader = IOHelper.newReader(profilePath)) {
|
try(Reader reader = IOHelper.newReader(profilePath)) {
|
||||||
profile = Launcher.gsonManager.gson.fromJson(reader, ClientProfile.class);
|
profile = Launcher.gsonManager.gson.fromJson(reader, ClientProfile.class);
|
||||||
}
|
}
|
||||||
profile.setTitle(args[1]);
|
var builder = new ClientProfileBuilder(profile);
|
||||||
profile.setUUID(UUID.randomUUID());
|
builder.setTitle(args[1]);
|
||||||
|
builder.setUuid(UUID.randomUUID());
|
||||||
if(profile.getServers().size() == 1) {
|
if(profile.getServers().size() == 1) {
|
||||||
profile.getServers().getFirst().name = args[1];
|
profile.getServers().getFirst().name = args[1];
|
||||||
}
|
}
|
||||||
|
@ -61,7 +63,8 @@ public void invoke(String... args) throws Exception {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
profile.setDir(args[1]);
|
builder.setDir(args[1]);
|
||||||
|
profile = builder.createClientProfile();
|
||||||
var targetPath = server.profilesDir.resolve(args[1].concat(".json"));
|
var targetPath = server.profilesDir.resolve(args[1].concat(".json"));
|
||||||
try(Writer writer = IOHelper.newWriter(targetPath)) {
|
try(Writer writer = IOHelper.newWriter(targetPath)) {
|
||||||
Launcher.gsonManager.gson.toJson(profile, writer);
|
Launcher.gsonManager.gson.toJson(profile, writer);
|
||||||
|
|
|
@ -23,7 +23,6 @@ public SaveProfilesCommand(LaunchServer server) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void saveProfile(ClientProfile profile, Path path) throws IOException {
|
public static void saveProfile(ClientProfile profile, Path path) throws IOException {
|
||||||
if (profile.getUUID() == null) profile.setUUID(UUID.randomUUID());
|
|
||||||
if (profile.getServers().isEmpty()) {
|
if (profile.getServers().isEmpty()) {
|
||||||
ClientProfile.ServerProfile serverProfile = new ClientProfile.ServerProfile();
|
ClientProfile.ServerProfile serverProfile = new ClientProfile.ServerProfile();
|
||||||
serverProfile.isDefault = true;
|
serverProfile.isDefault = true;
|
||||||
|
|
|
@ -109,14 +109,14 @@ public static String getPathSeparator() {
|
||||||
|
|
||||||
private void applyClientProfile() {
|
private void applyClientProfile() {
|
||||||
this.systemClassPath.add(IOHelper.getCodeSource(ClientLauncherEntryPoint.class).toAbsolutePath().toString());
|
this.systemClassPath.add(IOHelper.getCodeSource(ClientLauncherEntryPoint.class).toAbsolutePath().toString());
|
||||||
Collections.addAll(this.jvmArgs, this.params.profile.getJvmArgs());
|
this.jvmArgs.addAll(this.params.profile.getJvmArgs());
|
||||||
for (OptionalAction a : this.params.actions) {
|
for (OptionalAction a : this.params.actions) {
|
||||||
if (a instanceof OptionalActionJvmArgs) {
|
if (a instanceof OptionalActionJvmArgs) {
|
||||||
this.jvmArgs.addAll(((OptionalActionJvmArgs) a).args);
|
this.jvmArgs.addAll(((OptionalActionJvmArgs) a).args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.systemEnv.put("JAVA_HOME", javaVersion.jvmDir.toString());
|
this.systemEnv.put("JAVA_HOME", javaVersion.jvmDir.toString());
|
||||||
Collections.addAll(this.systemClassPath, this.params.profile.getAlternativeClassPath());
|
this.systemClassPath.addAll(this.params.profile.getAlternativeClassPath());
|
||||||
if (params.ram > 0) {
|
if (params.ram > 0) {
|
||||||
this.jvmArgs.add("-Xmx" + params.ram + 'M');
|
this.jvmArgs.add("-Xmx" + params.ram + 'M');
|
||||||
}
|
}
|
||||||
|
@ -128,8 +128,6 @@ private void applyClientProfile() {
|
||||||
this.params.oauthExpiredTime = Request.getTokenExpiredTime();
|
this.params.oauthExpiredTime = Request.getTokenExpiredTime();
|
||||||
this.params.extendedTokens = Request.getExtendedTokens();
|
this.params.extendedTokens = Request.getExtendedTokens();
|
||||||
}
|
}
|
||||||
this.jvmModules.addAll(this.params.profile.getModules());
|
|
||||||
this.jvmModulesPaths.addAll(this.params.profile.getModulePath());
|
|
||||||
LauncherEngine.modulesManager.invokeEvent(new ClientProcessBuilderCreateEvent(this));
|
LauncherEngine.modulesManager.invokeEvent(new ClientProcessBuilderCreateEvent(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +146,6 @@ public void start(boolean pipeOutput) throws IOException, InterruptedException {
|
||||||
processArgs.add("-javaagent:".concat(IOHelper.getCodeSource(ClientLauncherEntryPoint.class).toAbsolutePath().toString()));
|
processArgs.add("-javaagent:".concat(IOHelper.getCodeSource(ClientLauncherEntryPoint.class).toAbsolutePath().toString()));
|
||||||
} else if (params.profile.getClassLoaderConfig() == ClientProfile.ClassLoaderConfig.SYSTEM_ARGS) {
|
} else if (params.profile.getClassLoaderConfig() == ClientProfile.ClassLoaderConfig.SYSTEM_ARGS) {
|
||||||
systemClassPath.addAll(ClientLauncherEntryPoint.resolveClassPath(new HashSet<>(), 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)
|
.map(Path::toString)
|
||||||
.toList());
|
.toList());
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,6 @@ public final class ClientProfile implements Comparable<ClientProfile> {
|
||||||
@LauncherNetworkAPI
|
@LauncherNetworkAPI
|
||||||
private List<String> updateExclusions;
|
private List<String> updateExclusions;
|
||||||
@LauncherNetworkAPI
|
@LauncherNetworkAPI
|
||||||
private List<String> updateShared;
|
|
||||||
@LauncherNetworkAPI
|
|
||||||
private List<String> updateVerify;
|
private List<String> updateVerify;
|
||||||
@LauncherNetworkAPI
|
@LauncherNetworkAPI
|
||||||
private Set<OptionalFile> updateOptional;
|
private Set<OptionalFile> updateOptional;
|
||||||
|
@ -51,10 +49,6 @@ public final class ClientProfile implements Comparable<ClientProfile> {
|
||||||
@LauncherNetworkAPI
|
@LauncherNetworkAPI
|
||||||
private List<String> classPath;
|
private List<String> classPath;
|
||||||
@LauncherNetworkAPI
|
@LauncherNetworkAPI
|
||||||
private List<String> modulePath = new ArrayList<>();
|
|
||||||
@LauncherNetworkAPI
|
|
||||||
private List<String> modules = new ArrayList<>();
|
|
||||||
@LauncherNetworkAPI
|
|
||||||
private List<String> altClassPath;
|
private List<String> altClassPath;
|
||||||
@LauncherNetworkAPI
|
@LauncherNetworkAPI
|
||||||
private List<String> clientArgs;
|
private List<String> clientArgs;
|
||||||
|
@ -89,54 +83,37 @@ public final class ClientProfile implements Comparable<ClientProfile> {
|
||||||
@LauncherNetworkAPI
|
@LauncherNetworkAPI
|
||||||
private LaunchOptions.ModuleConf moduleConf;
|
private LaunchOptions.ModuleConf moduleConf;
|
||||||
|
|
||||||
public ClientProfile() {
|
public ClientProfile(String title, UUID uuid, Version version, String info, String dir, int sortIndex, String assetIndex, String assetDir, List<String> update, List<String> updateExclusions, List<String> updateVerify, Set<OptionalFile> updateOptional, List<String> jvmArgs, List<String> classPath, List<String> altClassPath, List<String> clientArgs, List<String> compatClasses, List<String> loadNatives, Map<String, String> properties, List<ServerProfile> servers, ClassLoaderConfig classLoaderConfig, List<CompatibilityFlags> flags, int recommendJavaVersion, int minJavaVersion, int maxJavaVersion, ProfileDefaultSettings settings, boolean limited, String mainClass, String mainModule, LaunchOptions.ModuleConf moduleConf) {
|
||||||
update = new ArrayList<>();
|
this.title = title;
|
||||||
updateExclusions = new ArrayList<>();
|
this.uuid = uuid;
|
||||||
updateShared = new ArrayList<>();
|
this.version = version;
|
||||||
updateVerify = new ArrayList<>();
|
this.info = info;
|
||||||
updateOptional = new HashSet<>();
|
this.dir = dir;
|
||||||
jvmArgs = new ArrayList<>();
|
this.sortIndex = sortIndex;
|
||||||
classPath = new ArrayList<>();
|
this.assetIndex = assetIndex;
|
||||||
modulePath = new ArrayList<>();
|
this.assetDir = assetDir;
|
||||||
altClassPath = new ArrayList<>();
|
|
||||||
clientArgs = new ArrayList<>();
|
|
||||||
compatClasses = new ArrayList<>();
|
|
||||||
properties = new HashMap<>();
|
|
||||||
servers = new ArrayList<>(1);
|
|
||||||
classLoaderConfig = ClassLoaderConfig.LAUNCHER;
|
|
||||||
flags = new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ClientProfile(List<String> update, List<String> updateExclusions, List<String> updateShared, List<String> updateVerify, Set<OptionalFile> updateOptional, List<String> jvmArgs, List<String> classPath, List<String> modulePath, List<String> modules, List<String> altClassPath, List<String> clientArgs, List<String> compatClasses, Map<String, String> properties, List<ServerProfile> servers, ClassLoaderConfig classLoaderConfig, List<CompatibilityFlags> flags, Version version, String assetIndex, String dir, String assetDir, int recommendJavaVersion, int minJavaVersion, int maxJavaVersion, ProfileDefaultSettings settings, int sortIndex, UUID uuid, String title, String info, String mainClass) {
|
|
||||||
this.update = update;
|
this.update = update;
|
||||||
this.updateExclusions = updateExclusions;
|
this.updateExclusions = updateExclusions;
|
||||||
this.updateShared = updateShared;
|
|
||||||
this.updateVerify = updateVerify;
|
this.updateVerify = updateVerify;
|
||||||
this.updateOptional = updateOptional;
|
this.updateOptional = updateOptional;
|
||||||
this.jvmArgs = jvmArgs;
|
this.jvmArgs = jvmArgs;
|
||||||
this.classPath = classPath;
|
this.classPath = classPath;
|
||||||
this.modulePath = modulePath;
|
|
||||||
this.modules = modules;
|
|
||||||
this.altClassPath = altClassPath;
|
this.altClassPath = altClassPath;
|
||||||
this.clientArgs = clientArgs;
|
this.clientArgs = clientArgs;
|
||||||
this.compatClasses = compatClasses;
|
this.compatClasses = compatClasses;
|
||||||
|
this.loadNatives = loadNatives;
|
||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
this.servers = servers;
|
this.servers = servers;
|
||||||
this.classLoaderConfig = classLoaderConfig;
|
this.classLoaderConfig = classLoaderConfig;
|
||||||
this.version = version;
|
this.flags = flags;
|
||||||
this.assetIndex = assetIndex;
|
|
||||||
this.dir = dir;
|
|
||||||
this.assetDir = assetDir;
|
|
||||||
this.recommendJavaVersion = recommendJavaVersion;
|
this.recommendJavaVersion = recommendJavaVersion;
|
||||||
this.minJavaVersion = minJavaVersion;
|
this.minJavaVersion = minJavaVersion;
|
||||||
this.maxJavaVersion = maxJavaVersion;
|
this.maxJavaVersion = maxJavaVersion;
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.sortIndex = sortIndex;
|
this.limited = limited;
|
||||||
this.uuid = uuid;
|
|
||||||
this.title = title;
|
|
||||||
this.info = info;
|
|
||||||
this.mainClass = mainClass;
|
this.mainClass = mainClass;
|
||||||
this.flags = flags;
|
this.mainModule = mainModule;
|
||||||
|
this.moduleConf = moduleConf;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerProfile getDefaultServerProfile() {
|
public ServerProfile getDefaultServerProfile() {
|
||||||
|
@ -159,34 +136,22 @@ public FileNameMatcher getAssetUpdateMatcher() {
|
||||||
return getVersion().compareTo(ClientProfileVersions.MINECRAFT_1_7_10) >= 0 ? ASSET_MATCHER : null;
|
return getVersion().compareTo(ClientProfileVersions.MINECRAFT_1_7_10) >= 0 ? ASSET_MATCHER : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getClassPath() {
|
public List<String> getClassPath() {
|
||||||
return classPath.toArray(new String[0]);
|
return Collections.unmodifiableList(classPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getModulePath() {
|
public List<String> getAlternativeClassPath() {
|
||||||
return Collections.unmodifiableList(modulePath);
|
return Collections.unmodifiableList(altClassPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getModules() {
|
public List<String> getClientArgs() {
|
||||||
return Collections.unmodifiableList(modules);
|
return Collections.unmodifiableList(clientArgs);
|
||||||
}
|
|
||||||
|
|
||||||
public String[] getAlternativeClassPath() {
|
|
||||||
return altClassPath.toArray(new String[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String[] getClientArgs() {
|
|
||||||
return clientArgs.toArray(new String[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDir() {
|
public String getDir() {
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDir(String dir) {
|
|
||||||
this.dir = dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAssetDir() {
|
public String getAssetDir() {
|
||||||
return assetDir;
|
return assetDir;
|
||||||
}
|
}
|
||||||
|
@ -195,24 +160,25 @@ public List<String> getUpdateExclusions() {
|
||||||
return Collections.unmodifiableList(updateExclusions);
|
return Collections.unmodifiableList(updateExclusions);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileNameMatcher getClientUpdateMatcher(/*boolean excludeOptional*/) {
|
public List<String> getUpdate() {
|
||||||
|
return Collections.unmodifiableList(update);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getUpdateVerify() {
|
||||||
|
return Collections.unmodifiableList(updateVerify);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FileNameMatcher getClientUpdateMatcher() {
|
||||||
String[] updateArray = update.toArray(new String[0]);
|
String[] updateArray = update.toArray(new String[0]);
|
||||||
String[] verifyArray = updateVerify.toArray(new String[0]);
|
String[] verifyArray = updateVerify.toArray(new String[0]);
|
||||||
List<String> excludeList;
|
List<String> excludeList;
|
||||||
//if(excludeOptional)
|
|
||||||
//{
|
|
||||||
// excludeList = new ArrayList<>();
|
|
||||||
// excludeList.addAll(updateExclusions);
|
|
||||||
// excludeList.addAll(updateOptional);
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
excludeList = updateExclusions;
|
excludeList = updateExclusions;
|
||||||
String[] exclusionsArray = excludeList.toArray(new String[0]);
|
String[] exclusionsArray = excludeList.toArray(new String[0]);
|
||||||
return new FileNameMatcher(updateArray, verifyArray, exclusionsArray);
|
return new FileNameMatcher(updateArray, verifyArray, exclusionsArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getJvmArgs() {
|
public List<String> getJvmArgs() {
|
||||||
return jvmArgs.toArray(new String[0]);
|
return Collections.unmodifiableList(jvmArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMainClass() {
|
public String getMainClass() {
|
||||||
|
@ -289,10 +255,6 @@ public OptionalFile getOptionalFile(String file) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<String> getShared() {
|
|
||||||
return updateShared;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getServerPort() {
|
public int getServerPort() {
|
||||||
ServerProfile profile = getDefaultServerProfile();
|
ServerProfile profile = getDefaultServerProfile();
|
||||||
return profile == null ? 25565 : profile.serverPort;
|
return profile == null ? 25565 : profile.serverPort;
|
||||||
|
@ -306,26 +268,14 @@ public String getTitle() {
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTitle(String title) {
|
|
||||||
this.title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getInfo() {
|
public String getInfo() {
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInfo(String info) {
|
|
||||||
this.info = info;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Version getVersion() {
|
public Version getVersion() {
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVersion(Version version) {
|
|
||||||
this.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public boolean isUpdateFastCheck() {
|
public boolean isUpdateFastCheck() {
|
||||||
return true;
|
return true;
|
||||||
|
@ -340,10 +290,6 @@ public UUID getUUID() {
|
||||||
return uuid;
|
return uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUUID(UUID uuid) {
|
|
||||||
this.uuid = uuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasFlag(CompatibilityFlags flag) {
|
public boolean hasFlag(CompatibilityFlags flag) {
|
||||||
return flags.contains(flag);
|
return flags.contains(flag);
|
||||||
}
|
}
|
||||||
|
@ -413,18 +359,6 @@ public String getProperty(String name) {
|
||||||
return properties.get(name);
|
return properties.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void putProperty(String name, String value) {
|
|
||||||
properties.put(name, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean containsProperty(String name) {
|
|
||||||
return properties.containsKey(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void clearProperties() {
|
|
||||||
properties.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, String> getProperties() {
|
public Map<String, String> getProperties() {
|
||||||
return Collections.unmodifiableMap(properties);
|
return Collections.unmodifiableMap(properties);
|
||||||
}
|
}
|
||||||
|
@ -450,10 +384,6 @@ public ClassLoaderConfig getClassLoaderConfig() {
|
||||||
return classLoaderConfig;
|
return classLoaderConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setClassLoaderConfig(ClassLoaderConfig classLoaderConfig) {
|
|
||||||
this.classLoaderConfig = classLoaderConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isLimited() {
|
public boolean isLimited() {
|
||||||
return limited;
|
return limited;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,136 +1,112 @@
|
||||||
package pro.gravit.launcher.base.profiles;
|
package pro.gravit.launcher.base.profiles;
|
||||||
|
|
||||||
import pro.gravit.launcher.base.profiles.optional.OptionalFile;
|
import pro.gravit.launcher.base.profiles.optional.OptionalFile;
|
||||||
|
import pro.gravit.utils.launch.LaunchOptions;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class ClientProfileBuilder {
|
public class ClientProfileBuilder {
|
||||||
private List<String> update = new ArrayList<>();
|
|
||||||
private List<String> updateExclusions = new ArrayList<>();
|
|
||||||
private List<String> updateShared = new ArrayList<>();
|
|
||||||
private List<String> updateVerify = new ArrayList<>();
|
|
||||||
private Set<OptionalFile> updateOptional = new HashSet<>();
|
|
||||||
private List<String> jvmArgs = new ArrayList<>();
|
|
||||||
private List<String> classPath = new ArrayList<>();
|
|
||||||
private List<String> modulePath = new ArrayList<>();
|
|
||||||
private List<String> modules = new ArrayList<>();
|
|
||||||
private List<String> altClassPath = new ArrayList<>();
|
|
||||||
private List<String> clientArgs = new ArrayList<>();
|
|
||||||
private List<String> compatClasses = new ArrayList<>();
|
|
||||||
private Map<String, String> properties = new HashMap<>();
|
|
||||||
private List<ClientProfile.ServerProfile> servers = new ArrayList<>();
|
|
||||||
private ClientProfile.ClassLoaderConfig classLoaderConfig = ClientProfile.ClassLoaderConfig.LAUNCHER;
|
|
||||||
private List<ClientProfile.CompatibilityFlags> flags = new ArrayList<>();
|
|
||||||
private ClientProfile.Version version;
|
|
||||||
private String assetIndex;
|
|
||||||
private String dir;
|
|
||||||
private String assetDir;
|
|
||||||
private int recommendJavaVersion = 8;
|
|
||||||
private int minJavaVersion = 8;
|
|
||||||
private int maxJavaVersion = 999;
|
|
||||||
private ClientProfile.ProfileDefaultSettings settings = new ClientProfile.ProfileDefaultSettings();
|
|
||||||
private int sortIndex;
|
|
||||||
private UUID uuid;
|
|
||||||
private String title;
|
private String title;
|
||||||
|
private UUID uuid;
|
||||||
|
private ClientProfile.Version version;
|
||||||
private String info;
|
private String info;
|
||||||
|
private String dir;
|
||||||
|
private int sortIndex;
|
||||||
|
private String assetIndex;
|
||||||
|
private String assetDir;
|
||||||
|
private List<String> update;
|
||||||
|
private List<String> updateExclusions;
|
||||||
|
private List<String> updateVerify;
|
||||||
|
private Set<OptionalFile> updateOptional;
|
||||||
|
private List<String> jvmArgs;
|
||||||
|
private List<String> classPath;
|
||||||
|
private List<String> altClassPath;
|
||||||
|
private List<String> clientArgs;
|
||||||
|
private List<String> compatClasses;
|
||||||
|
private List<String> loadNatives;
|
||||||
|
private Map<String, String> properties;
|
||||||
|
private List<ClientProfile.ServerProfile> servers;
|
||||||
|
private ClientProfile.ClassLoaderConfig classLoaderConfig;
|
||||||
|
private List<ClientProfile.CompatibilityFlags> flags;
|
||||||
|
private int recommendJavaVersion;
|
||||||
|
private int minJavaVersion;
|
||||||
|
private int maxJavaVersion;
|
||||||
|
private ClientProfile.ProfileDefaultSettings settings;
|
||||||
|
private boolean limited;
|
||||||
private String mainClass;
|
private String mainClass;
|
||||||
|
private String mainModule;
|
||||||
|
private LaunchOptions.ModuleConf moduleConf;
|
||||||
|
|
||||||
public void setUpdate(List<String> update) {
|
public ClientProfileBuilder() {
|
||||||
this.update = update;
|
this.update = new ArrayList<>();
|
||||||
|
this.updateExclusions = new ArrayList<>();
|
||||||
|
this.updateVerify = new ArrayList<>();
|
||||||
|
this.updateOptional = new HashSet<>();
|
||||||
|
this.jvmArgs = new ArrayList<>();
|
||||||
|
this.classPath = new ArrayList<>();
|
||||||
|
this.altClassPath = new ArrayList<>();
|
||||||
|
this.clientArgs = new ArrayList<>();
|
||||||
|
this.compatClasses = new ArrayList<>();
|
||||||
|
this.loadNatives = new ArrayList<>();
|
||||||
|
this.properties = new HashMap<>();
|
||||||
|
this.servers = new ArrayList<>();
|
||||||
|
this.flags = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClientProfileBuilder setUpdateExclusions(List<String> updateExclusions) {
|
public ClientProfileBuilder(ClientProfile profile) {
|
||||||
this.updateExclusions = updateExclusions;
|
this.title = profile.getTitle();
|
||||||
|
this.uuid = profile.getUUID();
|
||||||
|
this.version = profile.getVersion();
|
||||||
|
this.info = profile.getInfo();
|
||||||
|
this.dir = profile.getDir();
|
||||||
|
this.sortIndex = profile.getSortIndex();
|
||||||
|
this.assetIndex = profile.getAssetIndex();
|
||||||
|
this.assetDir = profile.getAssetDir();
|
||||||
|
this.update = new ArrayList<>(profile.getUpdate());
|
||||||
|
this.updateExclusions = new ArrayList<>(profile.getUpdateExclusions());
|
||||||
|
this.updateVerify = new ArrayList<>(profile.getUpdateVerify());
|
||||||
|
this.updateOptional = new HashSet<>(profile.getOptional());
|
||||||
|
this.jvmArgs = new ArrayList<>(profile.getJvmArgs());
|
||||||
|
this.classPath = new ArrayList<>(profile.getClassPath());
|
||||||
|
this.altClassPath = new ArrayList<>(profile.getAlternativeClassPath());
|
||||||
|
this.clientArgs = new ArrayList<>(profile.getClientArgs());
|
||||||
|
this.compatClasses = new ArrayList<>(profile.getCompatClasses());
|
||||||
|
this.loadNatives = new ArrayList<>(profile.getLoadNatives());
|
||||||
|
this.properties = new HashMap<>(profile.getProperties());
|
||||||
|
this.servers = new ArrayList<>(profile.getServers());
|
||||||
|
this.flags = new ArrayList<>(profile.getFlags());
|
||||||
|
this.recommendJavaVersion = profile.getRecommendJavaVersion();
|
||||||
|
this.minJavaVersion = profile.getMinJavaVersion();
|
||||||
|
this.maxJavaVersion = profile.getMaxJavaVersion();
|
||||||
|
this.settings = profile.getSettings();
|
||||||
|
this.limited = profile.isLimited();
|
||||||
|
this.mainClass = profile.getMainClass();
|
||||||
|
this.mainModule = profile.getMainModule();
|
||||||
|
this.moduleConf = profile.getModuleConf();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClientProfileBuilder setUpdateShared(List<String> updateShared) {
|
public ClientProfileBuilder setUuid(UUID uuid) {
|
||||||
this.updateShared = updateShared;
|
this.uuid = uuid;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUpdateVerify(List<String> updateVerify) {
|
public ClientProfileBuilder setVersion(ClientProfile.Version version) {
|
||||||
this.updateVerify = updateVerify;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUpdateOptional(Set<OptionalFile> updateOptional) {
|
|
||||||
this.updateOptional = updateOptional;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setJvmArgs(List<String> jvmArgs) {
|
|
||||||
this.jvmArgs = jvmArgs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClassPath(List<String> classPath) {
|
|
||||||
this.classPath = classPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAltClassPath(List<String> altClassPath) {
|
|
||||||
this.altClassPath = altClassPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClientArgs(List<String> clientArgs) {
|
|
||||||
this.clientArgs = clientArgs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ClientProfileBuilder setCompatClasses(List<String> compatClasses) {
|
|
||||||
this.compatClasses = compatClasses;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ClientProfileBuilder setProperties(Map<String, String> properties) {
|
|
||||||
this.properties = properties;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setServers(List<ClientProfile.ServerProfile> servers) {
|
|
||||||
this.servers = servers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClassLoaderConfig(ClientProfile.ClassLoaderConfig classLoaderConfig) {
|
|
||||||
this.classLoaderConfig = classLoaderConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVersion(ClientProfile.Version version) {
|
|
||||||
this.version = version;
|
this.version = version;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAssetIndex(String assetIndex) {
|
public ClientProfileBuilder setInfo(String info) {
|
||||||
this.assetIndex = assetIndex;
|
this.info = info;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDir(String dir) {
|
public ClientProfileBuilder setDir(String dir) {
|
||||||
this.dir = dir;
|
this.dir = dir;
|
||||||
}
|
|
||||||
|
|
||||||
public void setAssetDir(String assetDir) {
|
|
||||||
this.assetDir = assetDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRecommendJavaVersion(int recommendJavaVersion) {
|
|
||||||
this.recommendJavaVersion = recommendJavaVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ClientProfileBuilder setModulePath(List<String> modulePath) {
|
|
||||||
this.modulePath = modulePath;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ClientProfileBuilder setModules(List<String> modules) {
|
|
||||||
this.modules = modules;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMinJavaVersion(int minJavaVersion) {
|
|
||||||
this.minJavaVersion = minJavaVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMaxJavaVersion(int maxJavaVersion) {
|
|
||||||
this.maxJavaVersion = maxJavaVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ClientProfileBuilder setSettings(ClientProfile.ProfileDefaultSettings settings) {
|
|
||||||
this.settings = settings;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,20 +115,140 @@ public ClientProfileBuilder setSortIndex(int sortIndex) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUuid(UUID uuid) {
|
public ClientProfileBuilder setAssetIndex(String assetIndex) {
|
||||||
this.uuid = uuid;
|
this.assetIndex = assetIndex;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTitle(String title) {
|
public ClientProfileBuilder setAssetDir(String assetDir) {
|
||||||
this.title = title;
|
this.assetDir = assetDir;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInfo(String info) {
|
public ClientProfileBuilder setUpdate(List<String> update) {
|
||||||
this.info = info;
|
this.update = update;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMainClass(String mainClass) {
|
public ClientProfileBuilder update(String value) {
|
||||||
this.mainClass = mainClass;
|
this.update.add(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setUpdateExclusions(List<String> updateExclusions) {
|
||||||
|
this.updateExclusions = updateExclusions;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder updateExclusions(String value) {
|
||||||
|
this.updateExclusions.add(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setUpdateVerify(List<String> updateVerify) {
|
||||||
|
this.updateVerify = updateVerify;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder updateVerify(String value) {
|
||||||
|
this.updateVerify.add(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setUpdateOptional(Set<OptionalFile> updateOptional) {
|
||||||
|
this.updateOptional = updateOptional;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder updateOptional(OptionalFile value) {
|
||||||
|
this.updateOptional.add(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setJvmArgs(List<String> jvmArgs) {
|
||||||
|
this.jvmArgs = jvmArgs;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder jvmArg(String value) {
|
||||||
|
this.jvmArgs.add(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ClientProfileBuilder setClassPath(List<String> classPath) {
|
||||||
|
this.classPath = classPath;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder classPath(String value) {
|
||||||
|
this.classPath.add(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setAltClassPath(List<String> altClassPath) {
|
||||||
|
this.altClassPath = altClassPath;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder altClassPath(String value) {
|
||||||
|
this.altClassPath.add(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setClientArgs(List<String> clientArgs) {
|
||||||
|
this.clientArgs = clientArgs;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder clientArg(String value) {
|
||||||
|
this.clientArgs.add(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setCompatClasses(List<String> compatClasses) {
|
||||||
|
this.compatClasses = compatClasses;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder compatClass(String value) {
|
||||||
|
this.compatClasses.add(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setLoadNatives(List<String> loadNatives) {
|
||||||
|
this.loadNatives = loadNatives;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder loadNatives(String value) {
|
||||||
|
this.loadNatives.add(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setProperties(Map<String, String> properties) {
|
||||||
|
this.properties = properties;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder property(String name, String value) {
|
||||||
|
this.properties.put(name, value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setServers(List<ClientProfile.ServerProfile> servers) {
|
||||||
|
this.servers = servers;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder server(ClientProfile.ServerProfile value) {
|
||||||
|
this.servers.add(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setClassLoaderConfig(ClientProfile.ClassLoaderConfig classLoaderConfig) {
|
||||||
|
this.classLoaderConfig = classLoaderConfig;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClientProfileBuilder setFlags(List<ClientProfile.CompatibilityFlags> flags) {
|
public ClientProfileBuilder setFlags(List<ClientProfile.CompatibilityFlags> flags) {
|
||||||
|
@ -160,7 +256,52 @@ public ClientProfileBuilder setFlags(List<ClientProfile.CompatibilityFlags> flag
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder flag(ClientProfile.CompatibilityFlags value) {
|
||||||
|
this.flags.add(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setRecommendJavaVersion(int recommendJavaVersion) {
|
||||||
|
this.recommendJavaVersion = recommendJavaVersion;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setMinJavaVersion(int minJavaVersion) {
|
||||||
|
this.minJavaVersion = minJavaVersion;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setMaxJavaVersion(int maxJavaVersion) {
|
||||||
|
this.maxJavaVersion = maxJavaVersion;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setSettings(ClientProfile.ProfileDefaultSettings settings) {
|
||||||
|
this.settings = settings;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setLimited(boolean limited) {
|
||||||
|
this.limited = limited;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setMainClass(String mainClass) {
|
||||||
|
this.mainClass = mainClass;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setMainModule(String mainModule) {
|
||||||
|
this.mainModule = mainModule;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientProfileBuilder setModuleConf(LaunchOptions.ModuleConf moduleConf) {
|
||||||
|
this.moduleConf = moduleConf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public ClientProfile createClientProfile() {
|
public ClientProfile createClientProfile() {
|
||||||
return new ClientProfile(update, updateExclusions, updateShared, updateVerify, updateOptional, jvmArgs, classPath, modulePath, modules, altClassPath, clientArgs, compatClasses, properties, servers, classLoaderConfig, flags, version, assetIndex, dir, assetDir, recommendJavaVersion, minJavaVersion, maxJavaVersion, settings, sortIndex, uuid, title, info, mainClass);
|
return new ClientProfile(title, uuid, version, info, dir, sortIndex, assetIndex, assetDir, update, updateExclusions, updateVerify, updateOptional, jvmArgs, classPath, altClassPath, clientArgs, compatClasses, loadNatives, properties, servers, classLoaderConfig, flags, recommendJavaVersion, minJavaVersion, maxJavaVersion, settings, limited, mainClass, mainModule, moduleConf);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,17 +1,19 @@
|
||||||
package pro.gravit.launcher.base.profiles.optional.actions;
|
package pro.gravit.launcher.base.profiles.optional.actions;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class OptionalActionClassPath extends OptionalAction {
|
public class OptionalActionClassPath extends OptionalAction {
|
||||||
public String[] args;
|
public List<String> args;
|
||||||
public boolean useAltClasspath = false;
|
public boolean useAltClasspath = false;
|
||||||
|
|
||||||
public OptionalActionClassPath() {
|
public OptionalActionClassPath() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public OptionalActionClassPath(String[] args) {
|
public OptionalActionClassPath(List<String> args) {
|
||||||
this.args = args;
|
this.args = args;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OptionalActionClassPath(String[] args, boolean useAltClasspath) {
|
public OptionalActionClassPath(List<String> args, boolean useAltClasspath) {
|
||||||
this.args = args;
|
this.args = args;
|
||||||
this.useAltClasspath = useAltClasspath;
|
this.useAltClasspath = useAltClasspath;
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,6 @@ private static void realMain(String[] args) throws Throwable {
|
||||||
LogHelper.debug("Verifying ClientLauncher sign and classpath");
|
LogHelper.debug("Verifying ClientLauncher sign and classpath");
|
||||||
Set<Path> ignoredPath = new HashSet<>();
|
Set<Path> ignoredPath = new HashSet<>();
|
||||||
List<Path> classpath = resolveClassPath(ignoredPath, clientDir, params.actions, params.profile)
|
List<Path> classpath = resolveClassPath(ignoredPath, clientDir, params.actions, params.profile)
|
||||||
.filter(x -> !profile.getModulePath().contains(clientDir.relativize(x).toString()))
|
|
||||||
.collect(Collectors.toCollection(ArrayList::new));
|
.collect(Collectors.toCollection(ArrayList::new));
|
||||||
if(LogHelper.isDevEnabled()) {
|
if(LogHelper.isDevEnabled()) {
|
||||||
for(var e : classpath) {
|
for(var e : classpath) {
|
||||||
|
@ -253,11 +252,11 @@ public static void verifyHDir(Path dir, HashedDir hdir, FileNameMatcher matcher,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static LinkedList<Path> resolveClassPathList(Set<Path> ignorePaths, Path clientDir, String... classPath) throws IOException {
|
private static LinkedList<Path> resolveClassPathList(Set<Path> ignorePaths, Path clientDir, List<String> classPath) throws IOException {
|
||||||
return resolveClassPathStream(ignorePaths, clientDir, classPath).collect(Collectors.toCollection(LinkedList::new));
|
return resolveClassPathStream(ignorePaths, clientDir, classPath).collect(Collectors.toCollection(LinkedList::new));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Stream<Path> resolveClassPathStream(Set<Path> ignorePaths, Path clientDir, String... classPath) throws IOException {
|
private static Stream<Path> resolveClassPathStream(Set<Path> ignorePaths, Path clientDir, List<String> classPath) throws IOException {
|
||||||
Stream.Builder<Path> builder = Stream.builder();
|
Stream.Builder<Path> builder = Stream.builder();
|
||||||
for (String classPathEntry : classPath) {
|
for (String classPathEntry : classPath) {
|
||||||
Path path = clientDir.resolve(IOHelper.toPath(classPathEntry.replace(IOHelper.CROSS_SEPARATOR, IOHelper.PLATFORM_SEPARATOR)));
|
Path path = clientDir.resolve(IOHelper.toPath(classPathEntry.replace(IOHelper.CROSS_SEPARATOR, IOHelper.PLATFORM_SEPARATOR)));
|
||||||
|
@ -301,7 +300,7 @@ private static void launch(ClientProfile profile, ClientParams params) throws Th
|
||||||
params.addClientLegacyArgs(args);
|
params.addClientLegacyArgs(args);
|
||||||
System.setProperty("minecraft.applet.TargetDirectory", params.clientDir);
|
System.setProperty("minecraft.applet.TargetDirectory", params.clientDir);
|
||||||
}
|
}
|
||||||
Collections.addAll(args, profile.getClientArgs());
|
args.addAll(profile.getClientArgs());
|
||||||
for (OptionalAction action : params.actions) {
|
for (OptionalAction action : params.actions) {
|
||||||
if (action instanceof OptionalActionClientArgs) {
|
if (action instanceof OptionalActionClientArgs) {
|
||||||
args.addAll(((OptionalActionClientArgs) action).args);
|
args.addAll(((OptionalActionClientArgs) action).args);
|
||||||
|
|
|
@ -6,9 +6,9 @@ public final class Version implements Comparable<Version> {
|
||||||
|
|
||||||
public static final int MAJOR = 5;
|
public static final int MAJOR = 5;
|
||||||
public static final int MINOR = 6;
|
public static final int MINOR = 6;
|
||||||
public static final int PATCH = 1;
|
public static final int PATCH = 2;
|
||||||
public static final int BUILD = 1;
|
public static final int BUILD = 1;
|
||||||
public static final Version.Type RELEASE = Type.STABLE;
|
public static final Version.Type RELEASE = Type.DEV;
|
||||||
public final int major;
|
public final int major;
|
||||||
public final int minor;
|
public final int minor;
|
||||||
public final int patch;
|
public final int patch;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
id 'org.openjfx.javafxplugin' version '0.1.0' apply false
|
id 'org.openjfx.javafxplugin' version '0.1.0' apply false
|
||||||
}
|
}
|
||||||
group = 'pro.gravit.launcher'
|
group = 'pro.gravit.launcher'
|
||||||
version = '5.6.1'
|
version = '5.6.2-SNAPSHOT'
|
||||||
|
|
||||||
apply from: 'props.gradle'
|
apply from: 'props.gradle'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue