1
0
mirror of https://github.com/SKCraft/Launcher.git synced 2024-11-24 12:16:28 +01:00

Add flag in version info: loader should override version arguments

Fixes #4
This commit is contained in:
Henry Le Grys 2020-12-23 00:23:35 +00:00
parent b9fc461063
commit e22e70ea81
2 changed files with 8 additions and 0 deletions

View File

@ -54,6 +54,10 @@ public class ModernForgeLoaderProcessor implements ILoaderProcessor {
// Copy game arguments
List<GameArgument> gameArguments = info.getArguments().getGameArguments();
if (gameArguments != null) {
if (info.isOverridingArguments()) {
version.getArguments().getGameArguments().clear();
}
version.getArguments().getGameArguments().addAll(gameArguments);
}

View File

@ -6,6 +6,7 @@
package com.skcraft.launcher.model.loader;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.google.common.base.Splitter;
import com.skcraft.launcher.model.minecraft.GameArgument;
@ -24,6 +25,8 @@ public class VersionInfo {
private String mainClass;
private List<Library> libraries;
@JsonIgnore private transient boolean overridingArguments;
public void setMinecraftArguments(String argumentString) {
MinecraftArguments minecraftArguments = new MinecraftArguments();
minecraftArguments.setGameArguments(new ArrayList<GameArgument>());
@ -33,5 +36,6 @@ public class VersionInfo {
}
setArguments(minecraftArguments);
setOverridingArguments(true);
}
}