diff --git a/src/tconstruct/TConstruct.java b/src/tconstruct/TConstruct.java index 2355311d..a2eaf52d 100644 --- a/src/tconstruct/TConstruct.java +++ b/src/tconstruct/TConstruct.java @@ -23,12 +23,13 @@ import tconstruct.util.player.TPlayerHandler; import tconstruct.worldgen.*; import tconstruct.worldgen.village.*; +import java.util.ArrayList; +import java.util.List; import java.util.logging.Logger; /** TConstruct, the tool mod. * Craft your tools with style, then modify until the original is gone! - * @author: mDiyo - * @dependencies: IC2 API, MFR API + * @author mDiyo */ @Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.X_1.5.0d", dependencies = "required-after:Forge@[8.9,)") @@ -74,6 +75,14 @@ public class TConstruct else 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); + } } @EventHandler diff --git a/src/tconstruct/plugins/misc/PeaceOfMind.java b/src/tconstruct/plugins/misc/PeaceOfMind.java index fdec2f2d..ac2ddc3c 100644 --- a/src/tconstruct/plugins/misc/PeaceOfMind.java +++ b/src/tconstruct/plugins/misc/PeaceOfMind.java @@ -8,7 +8,7 @@ import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.ModContainer; -@Mod(modid = "TConstruct|PeaceOfMind", name = "TConstruct|PeaceOfMind", version = "1.0") +@Mod(modid = "TConstruct|PeaceOfMind", name = "TConstruct|PeaceOfMind", version = "1.0", dependencies = "after:TConstruct;after:gregtech_addon") // After TCon so any crashes are marked properly in callable public class PeaceOfMind { public static boolean completeShutdown = false; diff --git a/src/tconstruct/util/CallableUnsuppConfig.java b/src/tconstruct/util/CallableUnsuppConfig.java new file mode 100644 index 00000000..aa8b775e --- /dev/null +++ b/src/tconstruct/util/CallableUnsuppConfig.java @@ -0,0 +1,33 @@ +package tconstruct.util; + +import cpw.mods.fml.common.ICrashCallable; + +import java.util.List; + +// Crash handler for when an unsupported mod is running alongside us +public class CallableUnsuppConfig implements ICrashCallable { + + private List modIds; + + public CallableUnsuppConfig(List modIds) { + this.modIds = modIds; + } + + @Override + public String getLabel() { + return "TConstruct Environment"; + } + + @Override + public String call() throws Exception { + String str = "DO NOT REPORT THIS CRASH! Unsupported mods in environment: "; + Boolean firstEntry = true; + for (String id : modIds) { + str = str + (firstEntry ? id : ", " + id); + firstEntry = false; + } + + return str; + } + +}