From 3cc8ecde4ae88b37a7bedfb4181cbb448a84b223 Mon Sep 17 00:00:00 2001 From: maskers <97827489+mskrss@users.noreply.github.com> Date: Mon, 15 Jul 2024 20:51:23 +0300 Subject: [PATCH] detect launching offline without having minecraft assets downloaded --- src/handlers/event/analyze_logs/issues.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/handlers/event/analyze_logs/issues.rs b/src/handlers/event/analyze_logs/issues.rs index 21b7676..6854c91 100644 --- a/src/handlers/event/analyze_logs/issues.rs +++ b/src/handlers/event/analyze_logs/issues.rs @@ -26,6 +26,7 @@ pub async fn find(log: &str, data: &Data) -> Result> { forge_missing_dependencies, legacyjavafixer, locked_jar, + offline_launch, ]; let mut res: Vec<(String, String)> = issues.iter().filter_map(|issue| issue(log)).collect(); @@ -309,4 +310,16 @@ fn locked_jar(log: &str) -> Issue { let found = log.contains("Couldn't extract native jar"); found.then_some(issue) +} + +fn offline_launch(log: &str) -> Issue { + let issue = ( + "Missing Libraries".to_string(), + "You seem to be missing libraries. + To fix this, try doing `Edit > Version > Download All` and then launching your instance again." + .to_string(), + ); + + let found = log.contains("(missing)\n"); + found.then_some(issue) } \ No newline at end of file