fix(auto-installing): catch logs of forge-installer. Closes #1420.

This commit is contained in:
huanghongxun
2022-05-22 14:24:25 +08:00
parent fd098a65c5
commit 1aa3860706
3 changed files with 32 additions and 9 deletions

View File

@@ -23,7 +23,6 @@ import javafx.application.Platform;
import org.jackhuang.hmcl.Metadata;
import org.jackhuang.hmcl.event.Event;
import org.jackhuang.hmcl.event.EventManager;
import org.jackhuang.hmcl.launch.StreamPump;
import org.jackhuang.hmcl.task.FileDownloadTask;
import org.jackhuang.hmcl.task.Task;
import org.jackhuang.hmcl.ui.FXUtils;
@@ -358,8 +357,8 @@ public final class MultiplayerManager {
this.type = type;
addRelatedThread(Lang.thread(this::waitFor, "CatoExitWaiter", true));
addRelatedThread(Lang.thread(new StreamPump(process.getInputStream(), this::checkCatoLog), "CatoInputStreamPump", true));
addRelatedThread(Lang.thread(new StreamPump(process.getErrorStream(), this::checkCatoLog), "CatoErrorStreamPump", true));
pumpInputStream(this::checkCatoLog);
pumpErrorStream(this::checkCatoLog);
writer = new BufferedWriter(new OutputStreamWriter(process.getOutputStream(), StandardCharsets.UTF_8));
}