mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-15 23:06:07 -04:00
fix: checkstyle.
This commit is contained in:
parent
8153d3bda9
commit
2f5a9a50af
@ -129,16 +129,19 @@ public final class MultiplayerManager {
|
|||||||
|
|
||||||
this.name = name;
|
this.name = name;
|
||||||
addRelatedThread(Lang.thread(this::waitFor, "CatoExitWaiter", true));
|
addRelatedThread(Lang.thread(this::waitFor, "CatoExitWaiter", true));
|
||||||
addRelatedThread(Lang.thread(new StreamPump(process.getErrorStream(), it -> {
|
addRelatedThread(Lang.thread(new StreamPump(process.getInputStream(), this::checkCatoLog), "CatoInputStreamPump", true));
|
||||||
if (id == null) {
|
addRelatedThread(Lang.thread(new StreamPump(process.getErrorStream(), this::checkCatoLog), "CatoErrorStreamPump", true));
|
||||||
LOG.info("Cato: " + it);
|
}
|
||||||
Matcher matcher = TEMP_TOKEN_PATTERN.matcher(it);
|
|
||||||
if (matcher.find()) {
|
private void checkCatoLog(String log) {
|
||||||
id = "mix" + matcher.group("id");
|
if (id == null) {
|
||||||
onIdGenerated.fireEvent(new CatoIdEvent(this, id));
|
LOG.info("Cato: " + log);
|
||||||
}
|
Matcher matcher = TEMP_TOKEN_PATTERN.matcher(log);
|
||||||
|
if (matcher.find()) {
|
||||||
|
id = "mix" + matcher.group("id");
|
||||||
|
onIdGenerated.fireEvent(new CatoIdEvent(this, id));
|
||||||
}
|
}
|
||||||
}), "CatoStreamPump", true));
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void waitFor() {
|
private void waitFor() {
|
||||||
|
@ -10,7 +10,11 @@ import java.util.*;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class CrashReportAnalyzer {
|
public final class CrashReportAnalyzer {
|
||||||
|
|
||||||
|
private CrashReportAnalyzer() {
|
||||||
|
}
|
||||||
|
|
||||||
public enum Rule {
|
public enum Rule {
|
||||||
// We manually write "Pattern.compile" here for IDEA syntax highlighting.
|
// We manually write "Pattern.compile" here for IDEA syntax highlighting.
|
||||||
|
|
||||||
@ -165,4 +169,4 @@ public class CrashReportAnalyzer {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -406,7 +406,7 @@ public class DefaultLauncher extends Launcher {
|
|||||||
env.put("INST_NAME", versionName);
|
env.put("INST_NAME", versionName);
|
||||||
env.put("INST_ID", versionName);
|
env.put("INST_ID", versionName);
|
||||||
env.put("INST_DIR", repository.getVersionRoot(version.getId()).getAbsolutePath());
|
env.put("INST_DIR", repository.getVersionRoot(version.getId()).getAbsolutePath());
|
||||||
env.put("INST_MC_DIR", repository.getRunDirectory(version.getId()).getAbsolutePath());
|
env.put("INST_MC_DIR", repository.getRunDirectory(version.getId()).getAbsolutePath());
|
||||||
env.put("INST_JAVA", options.getJava().getBinary().toString());
|
env.put("INST_JAVA", options.getJava().getBinary().toString());
|
||||||
|
|
||||||
LibraryAnalyzer analyzer = LibraryAnalyzer.analyze(version);
|
LibraryAnalyzer analyzer = LibraryAnalyzer.analyze(version);
|
||||||
@ -452,6 +452,7 @@ public class DefaultLauncher extends Launcher {
|
|||||||
writer.write("@echo off");
|
writer.write("@echo off");
|
||||||
writer.newLine();
|
writer.newLine();
|
||||||
writer.write("set APPDATA=" + options.getGameDir().getAbsoluteFile().getParent());
|
writer.write("set APPDATA=" + options.getGameDir().getAbsoluteFile().getParent());
|
||||||
|
writer.newLine();
|
||||||
for (Map.Entry<String, String> entry : getEnvVars().entrySet()) {
|
for (Map.Entry<String, String> entry : getEnvVars().entrySet()) {
|
||||||
writer.write("set " + entry.getKey() + "=" + entry.getValue());
|
writer.write("set " + entry.getKey() + "=" + entry.getValue());
|
||||||
writer.newLine();
|
writer.newLine();
|
||||||
|
@ -29,6 +29,7 @@ public final class DownloadManager {
|
|||||||
|
|
||||||
public interface IMod {
|
public interface IMod {
|
||||||
List<Mod> loadDependencies() throws IOException;
|
List<Mod> loadDependencies() throws IOException;
|
||||||
|
|
||||||
Stream<Version> loadVersions() throws IOException;
|
Stream<Version> loadVersions() throws IOException;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user