diff --git a/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java b/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java index 6c7d38f7..a604ccf8 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java @@ -117,7 +117,7 @@ public int hashCode() { private final BooleanConfigEntry useWhitelist; // Client launcher private final StringConfigEntry mainClass; - private final ListConfigEntry jvmArgs; + private final List jvmArgs= new ArrayList<>(); private final ListConfigEntry classPath; private final ListConfigEntry clientArgs; @@ -150,7 +150,7 @@ public ClientProfile(BlockConfigEntry block) { // Client launcher mainClass = block.getEntry("mainClass", StringConfigEntry.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); whitelist = block.getEntry("whitelist", ListConfigEntry.class); } @@ -204,7 +204,7 @@ public FileNameMatcher getClientUpdateMatcher(/*boolean excludeOptional*/) { @LauncherAPI public String[] getJvmArgs() { - return jvmArgs.stream(StringConfigEntry.class).toArray(String[]::new); + return jvmArgs.toArray(new String[0]); } @LauncherAPI @@ -309,7 +309,6 @@ public void verify() { VerifyHelper.verifyInt(getServerPort(), VerifyHelper.range(0, 65535), "Illegal server port: " + getServerPort()); // Client launcher - jvmArgs.verifyOfType(ConfigEntry.Type.STRING); classPath.verifyOfType(ConfigEntry.Type.STRING); clientArgs.verifyOfType(ConfigEntry.Type.STRING); VerifyHelper.verify(getTitle(), VerifyHelper.NOT_EMPTY, "Main class can't be empty");