Remove redundant call to CrashReport generator - Vanilla is doing a crashreport for itself at startup now.

Add a UUID into crashreport that is also logged in all channels at crash report generation time. This will allow to associate crash reports and the logs.

Signed-off-by: cpw <cpw+github@weeksfamily.ca>
This commit is contained in:
cpw 2020-10-04 16:40:38 -04:00
parent 3fe5ddd68f
commit 09be003d61
No known key found for this signature in database
GPG Key ID: 8EB3DF749553B1B7
3 changed files with 7 additions and 10 deletions

View File

@ -75,6 +75,7 @@ import org.apache.logging.log4j.MarkerManager;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
@Mod("forge")
public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook
@ -102,6 +103,11 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook
LOGGER.info(FORGEMOD,"Forge mod loading, version {}, for MC {} with MCP {}", ForgeVersion.getVersion(), MCPVersion.getMCVersion(), MCPVersion.getMCPVersion());
INSTANCE = this;
MinecraftForge.initialize();
CrashReportExtender.registerCrashCallable("Crash Report UUID", ()-> {
final UUID uuid = UUID.randomUUID();
LOGGER.fatal("Preparing crash report with UUID {}", uuid);
return uuid.toString();
});
WorldPersistenceHooks.addHook(this);
WorldPersistenceHooks.addHook(new FMLWorldPersistenceHook());
final IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();

View File

@ -53,9 +53,6 @@ public class MinecraftForge
UsernameCache.load();
ForgeHooks.initTools();
//For all the normal CrashReport classes to be defined. We're in MC's classloader so this should all be fine
new CrashReport("ThisIsFake", new Exception("Not real"));
}

View File

@ -44,13 +44,7 @@ import net.minecraftforge.versions.forge.ForgeVersion;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.Executor;