Skip to content

Commit

Permalink
Tweak register timing
Browse files Browse the repository at this point in the history
  • Loading branch information
xfl03 committed May 2, 2020
1 parent c960745 commit 36cff84
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
}
apply plugin: 'net.minecraftforge.gradle'

version = '1.0.3'
version = '1.0.4'
group = 'me.xfl03'
archivesBaseName = 'MoreCrashInfo'

Expand Down
5 changes: 0 additions & 5 deletions src/main/java/me/xfl03/morecrashinfo/MoreCrashInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ private void setup(final FMLCommonSetupEvent event)
{
LOGGER.debug("MoreCrashInfo: PreInit Begin.");

CrashReportExtender.registerCrashCallable(new ModList());
CrashReportExtender.registerCrashCallable(new CoreModList());

CrashHandler.registerHandler(VerifyError.class, VerifyErrorHandler::new);

LOGGER.debug("MoreCrashInfo: PreInit End.");
}

Expand Down
12 changes: 11 additions & 1 deletion src/main/java/me/xfl03/morecrashinfo/handler/CrashHandler.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
package me.xfl03.morecrashinfo.handler;

import cpw.mods.modlauncher.log.TransformingThrowablePatternConverter;
import me.xfl03.morecrashinfo.crash.CoreModList;
import me.xfl03.morecrashinfo.crash.ModList;
import me.xfl03.morecrashinfo.handler.exception.*;
import net.minecraft.crash.CrashReport;
import net.minecraftforge.fml.CrashReportExtender;

import java.util.*;
import java.util.function.Function;

public class CrashHandler {

private static Map<Class, Function<Throwable, ExceptionHandler>> handlers = new HashMap<>();

static {
CrashHandler.registerHandler(VerifyError.class, VerifyErrorHandler::new);

CrashReportExtender.registerCrashCallable(new ModList());
CrashReportExtender.registerCrashCallable(new CoreModList());
}

private static ExceptionHandler handler;

public static void registerHandler(Class exception, Function<Throwable, ExceptionHandler> handler) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ loaderVersion="[25,)"
issueTrackerURL="http://github.com/xfl03/MoreCrashInfo/issues"
[[mods]]
modId="morecrashinfo"
version="1.0.3"
version="1.0.4"
displayName="MoreCrashInfo"
displayURL="http://github.com/xfl03/MoreCrashInfo"
credits=""
Expand Down

0 comments on commit 36cff84

Please sign in to comment.