From 401c62073141312708c6f6c5a7d3da539049b459 Mon Sep 17 00:00:00 2001 From: maskers <97827489+mskrss@users.noreply.github.com> Date: Fri, 6 Jun 2025 11:17:46 +0300 Subject: [PATCH] corrupted mmc-pack.json --- 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 2f77d43..5bee861 100644 --- a/src/handlers/event/analyze_logs/issues.rs +++ b/src/handlers/event/analyze_logs/issues.rs @@ -39,6 +39,7 @@ pub async fn find(log: &str, data: &Data) -> Result> { spark_macos, xrandr, folder_name, + corrupted_instance, ]; let mut res: Vec<(String, String)> = issues.iter().filter_map(|issue| issue(log)).collect(); @@ -497,3 +498,15 @@ fn folder_name(log: &str) -> Issue { found.then_some(issue) } + +fn corrupted_instance(log: &str) -> Issue { + let issue = ( + "Corrupted instance files".to_string(), + "Your instance's `mmc-pack.json` appears to be corrupted. Make a new instance and copy over your data between `.minecraft` folders. To prevent this in the future, ensure your system has sufficient disk space and avoid forcefully shutting down your PC." + .to_string(), + ); + + let found = log.contains("mmc-pack.json as json: illegal value"); + + found.then_some(issue) +}