fix: #678
This commit is contained in:
@@ -46,10 +46,8 @@ public final class VersionLibraryBuilder {
|
||||
// Since $ will be escaped in linux, and our maintain of minecraftArgument will not cause escaping,
|
||||
// so we regenerate the minecraftArgument without escaping.
|
||||
ret = ret.setMinecraftArguments(new CommandBuilder().addAllWithoutParsing(mcArgs).toString());
|
||||
} else {
|
||||
ret = ret.setArguments(ret.getArguments().map(args -> args.withGame(game)).orElse(new Arguments(game, null)));
|
||||
}
|
||||
return ret;
|
||||
return ret.setArguments(ret.getArguments().map(args -> args.withGame(game)).orElse(new Arguments(game, null)));
|
||||
}
|
||||
|
||||
public void removeTweakClass(String target) {
|
||||
@@ -63,19 +61,19 @@ public final class VersionLibraryBuilder {
|
||||
--i;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i + 1 < game.size(); ++i) {
|
||||
Argument arg0 = game.get(i);
|
||||
Argument arg1 = game.get(i + 1);
|
||||
if (arg0 instanceof StringArgument && arg1 instanceof StringArgument) {
|
||||
// We need to preserve the tokens
|
||||
String arg0Str = arg0.toString();
|
||||
String arg1Str = arg1.toString();
|
||||
if (arg0Str.equals("--tweakClass") && arg1Str.toLowerCase().contains(target)) {
|
||||
game.remove(i);
|
||||
game.remove(i);
|
||||
--i;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i + 1 < game.size(); ++i) {
|
||||
Argument arg0 = game.get(i);
|
||||
Argument arg1 = game.get(i + 1);
|
||||
if (arg0 instanceof StringArgument && arg1 instanceof StringArgument) {
|
||||
// We need to preserve the tokens
|
||||
String arg0Str = arg0.toString();
|
||||
String arg1Str = arg1.toString();
|
||||
if (arg0Str.equals("--tweakClass") && arg1Str.toLowerCase().contains(target)) {
|
||||
game.remove(i);
|
||||
game.remove(i);
|
||||
--i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,10 @@ public class DefaultLauncher extends Launcher {
|
||||
res.addAll(Arguments.parseStringArguments(version.getMinecraftArguments().map(StringUtils::tokenize).orElseGet(LinkedList::new), configuration));
|
||||
|
||||
Map<String, Boolean> features = getFeatures();
|
||||
res.addAll(Arguments.parseArguments(version.getArguments().map(Arguments::getGame).orElseGet(this::getDefaultGameArguments), configuration, features));
|
||||
version.getArguments().map(Arguments::getGame).ifPresent(arguments -> res.addAll(Arguments.parseArguments(arguments, configuration, features)));
|
||||
if (version.getMinecraftArguments().isPresent()) {
|
||||
res.addAll(Arguments.parseArguments(this.getDefaultGameArguments(), configuration, features));
|
||||
}
|
||||
if (authInfo.getArguments() != null && authInfo.getArguments().getGame() != null && !authInfo.getArguments().getGame().isEmpty())
|
||||
res.addAll(Arguments.parseArguments(authInfo.getArguments().getGame(), configuration, features));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user