From dcfcc3e7c58832d24c34154ab1d782e962b59c76 Mon Sep 17 00:00:00 2001 From: Sunstrike Date: Tue, 22 Oct 2013 20:09:21 +0100 Subject: [PATCH] Squirrel away env checks to new helper --- src/tconstruct/TConstruct.java | 8 +------ src/tconstruct/util/EnvironmentChecks.java | 27 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 src/tconstruct/util/EnvironmentChecks.java diff --git a/src/tconstruct/TConstruct.java b/src/tconstruct/TConstruct.java index a2eaf52d..7e3cc1b9 100644 --- a/src/tconstruct/TConstruct.java +++ b/src/tconstruct/TConstruct.java @@ -76,13 +76,7 @@ public class TConstruct TConstruct.logger.info("[TConstruct] Preparing to take over the world"); } - if (Loader.isModLoaded("gregtech_addon")) { - List modIds = new ArrayList(); - modIds.add("gregtech_addon"); - - ICrashCallable callable = new CallableUnsuppConfig(modIds); - FMLCommonHandler.instance().registerCrashCallable(callable); - } + EnvironmentChecks.verifyEnvironmentSanity(); } @EventHandler diff --git a/src/tconstruct/util/EnvironmentChecks.java b/src/tconstruct/util/EnvironmentChecks.java new file mode 100644 index 00000000..f011209b --- /dev/null +++ b/src/tconstruct/util/EnvironmentChecks.java @@ -0,0 +1,27 @@ +package tconstruct.util; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.ICrashCallable; +import cpw.mods.fml.common.Loader; + +import java.util.ArrayList; +import java.util.List; + +public class EnvironmentChecks { + + private EnvironmentChecks() {} // Singleton + + /** + * Checks for conflicting stuff in environment; adds callable to any crash logs if so. + */ + public static void verifyEnvironmentSanity() { + if (Loader.isModLoaded("gregtech_addon")) { + List modIds = new ArrayList(); + modIds.add("gregtech_addon"); + + ICrashCallable callable = new CallableUnsuppConfig(modIds); + FMLCommonHandler.instance().registerCrashCallable(callable); + } + } + +}