mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
Оптимизация списка JVM опций
This commit is contained in:
parent
ad924961e6
commit
4c4ff840d4
1 changed files with 3 additions and 4 deletions
|
@ -117,7 +117,7 @@ public int hashCode() {
|
||||||
private final BooleanConfigEntry useWhitelist;
|
private final BooleanConfigEntry useWhitelist;
|
||||||
// Client launcher
|
// Client launcher
|
||||||
private final StringConfigEntry mainClass;
|
private final StringConfigEntry mainClass;
|
||||||
private final ListConfigEntry jvmArgs;
|
private final List<String> jvmArgs= new ArrayList<>();
|
||||||
private final ListConfigEntry classPath;
|
private final ListConfigEntry classPath;
|
||||||
private final ListConfigEntry clientArgs;
|
private final ListConfigEntry clientArgs;
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ public ClientProfile(BlockConfigEntry block) {
|
||||||
// Client launcher
|
// Client launcher
|
||||||
mainClass = block.getEntry("mainClass", StringConfigEntry.class);
|
mainClass = block.getEntry("mainClass", StringConfigEntry.class);
|
||||||
classPath = block.getEntry("classPath", ListConfigEntry.class);
|
classPath = block.getEntry("classPath", ListConfigEntry.class);
|
||||||
jvmArgs = block.getEntry("jvmArgs", ListConfigEntry.class);
|
block.getEntry("jvmArgs", ListConfigEntry.class).stream(StringConfigEntry.class).forEach(jvmArgs::add);
|
||||||
clientArgs = block.getEntry("clientArgs", ListConfigEntry.class);
|
clientArgs = block.getEntry("clientArgs", ListConfigEntry.class);
|
||||||
whitelist = block.getEntry("whitelist", ListConfigEntry.class);
|
whitelist = block.getEntry("whitelist", ListConfigEntry.class);
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,7 @@ public FileNameMatcher getClientUpdateMatcher(/*boolean excludeOptional*/) {
|
||||||
|
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
public String[] getJvmArgs() {
|
public String[] getJvmArgs() {
|
||||||
return jvmArgs.stream(StringConfigEntry.class).toArray(String[]::new);
|
return jvmArgs.toArray(new String[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
|
@ -309,7 +309,6 @@ public void verify() {
|
||||||
VerifyHelper.verifyInt(getServerPort(), VerifyHelper.range(0, 65535), "Illegal server port: " + getServerPort());
|
VerifyHelper.verifyInt(getServerPort(), VerifyHelper.range(0, 65535), "Illegal server port: " + getServerPort());
|
||||||
|
|
||||||
// Client launcher
|
// Client launcher
|
||||||
jvmArgs.verifyOfType(ConfigEntry.Type.STRING);
|
|
||||||
classPath.verifyOfType(ConfigEntry.Type.STRING);
|
classPath.verifyOfType(ConfigEntry.Type.STRING);
|
||||||
clientArgs.verifyOfType(ConfigEntry.Type.STRING);
|
clientArgs.verifyOfType(ConfigEntry.Type.STRING);
|
||||||
VerifyHelper.verify(getTitle(), VerifyHelper.NOT_EMPTY, "Main class can't be empty");
|
VerifyHelper.verify(getTitle(), VerifyHelper.NOT_EMPTY, "Main class can't be empty");
|
||||||
|
|
Loading…
Reference in a new issue