fix: cannot change init window dimension

This commit is contained in:
huanghongxun
2020-02-21 00:23:21 +08:00
parent 6ad5ba3736
commit 0fa324452f

View File

@@ -46,8 +46,10 @@ public final class VersionLibraryBuilder {
// Since $ will be escaped in linux, and our maintain of minecraftArgument will not cause escaping, // Since $ will be escaped in linux, and our maintain of minecraftArgument will not cause escaping,
// so we regenerate the minecraftArgument without escaping. // so we regenerate the minecraftArgument without escaping.
ret = ret.setMinecraftArguments(new CommandBuilder().addAllWithoutParsing(mcArgs).toString()); 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.setArguments(ret.getArguments().map(args -> args.withGame(game)).orElse(new Arguments(game, null))); return ret;
} }
public void removeTweakClass(String target) { public void removeTweakClass(String target) {
@@ -61,19 +63,19 @@ public final class VersionLibraryBuilder {
--i; --i;
} }
} }
} } else {
for (int i = 0; i + 1 < game.size(); ++i) {
for (int i = 0; i + 1 < game.size(); ++i) { Argument arg0 = game.get(i);
Argument arg0 = game.get(i); Argument arg1 = game.get(i + 1);
Argument arg1 = game.get(i + 1); if (arg0 instanceof StringArgument && arg1 instanceof StringArgument) {
if (arg0 instanceof StringArgument && arg1 instanceof StringArgument) { // We need to preserve the tokens
// We need to preserve the tokens String arg0Str = arg0.toString();
String arg0Str = arg0.toString(); String arg1Str = arg1.toString();
String arg1Str = arg1.toString(); if (arg0Str.equals("--tweakClass") && arg1Str.toLowerCase().contains(target)) {
if (arg0Str.equals("--tweakClass") && arg1Str.toLowerCase().contains(target)) { game.remove(i);
game.remove(i); game.remove(i);
game.remove(i); --i;
--i; }
} }
} }
} }