2025-11-24 22:52:51 +03:00

32 lines
972 B
Java

/*
* Decompiled with CFR 0.152.
*/
package com.mojang.blaze3d.platform;
import java.io.File;
import java.time.Duration;
import net.minecraft.CrashReport;
import net.minecraft.client.Minecraft;
import net.minecraft.server.dedicated.ServerWatchdog;
public class ClientShutdownWatchdog {
private static final Duration CRASH_REPORT_PRELOAD_LOAD = Duration.ofSeconds(15L);
public static void startShutdownWatchdog(File gameDirectory, long mainThreadId) {
Thread thread = new Thread(() -> {
try {
Thread.sleep(CRASH_REPORT_PRELOAD_LOAD);
}
catch (InterruptedException e) {
return;
}
CrashReport report = ServerWatchdog.createWatchdogCrashReport("Client shutdown", mainThreadId);
Minecraft.saveReport(gameDirectory, report);
});
thread.setDaemon(true);
thread.setName("Client shutdown watchdog");
thread.start();
}
}