From 6028ea74cbc20a99e04249e64c3938509a4c59d2 Mon Sep 17 00:00:00 2001 From: Sunstrike Date: Wed, 30 Oct 2013 22:15:03 +0000 Subject: [PATCH] Add Optifine to unsupported mod checks. Also moves the GT log note to Env Checks. --- src/tconstruct/util/EnvironmentChecks.java | 22 +++++++++++++-------- src/tconstruct/util/config/PHConstruct.java | 2 -- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/tconstruct/util/EnvironmentChecks.java b/src/tconstruct/util/EnvironmentChecks.java index a0c2fc5c..2ea6e4c0 100644 --- a/src/tconstruct/util/EnvironmentChecks.java +++ b/src/tconstruct/util/EnvironmentChecks.java @@ -1,8 +1,11 @@ package tconstruct.util; +import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.ICrashCallable; import cpw.mods.fml.common.Loader; +import cpw.mods.fml.relauncher.Side; +import tconstruct.TConstruct; import java.util.ArrayList; import java.util.List; @@ -15,21 +18,24 @@ public class EnvironmentChecks { * Checks for conflicting stuff in environment; adds callable to any crash logs if so. */ public static void verifyEnvironmentSanity() { - boolean supportedEnv = true; + List modIds = new ArrayList(); if (Loader.isModLoaded("gregtech_addon")) { - List modIds = new ArrayList(); + TConstruct.logger.severe("[Environment Checks] Gelatinous iceberg dead ahead! Entering Greggy waters! Abandon hope all ye who enter here! (No, seriously, we don't support GT. Don't report any issues. Thanks.)"); modIds.add("gregtech_addon"); - - ICrashCallable callable = new CallableUnsuppConfig(modIds); - FMLCommonHandler.instance().registerCrashCallable(callable); - - supportedEnv = false; } - if (supportedEnv) { + if (FMLCommonHandler.instance().getSide() == Side.CLIENT && FMLClientHandler.instance().hasOptifine()) { + TConstruct.logger.severe("[Environment Checks] Optifine detected. This is a Bad Thing(tm) and can crash Minecraft due to an Optifine bug during TCon armor renders!"); + modIds.add("optifine"); + } + + if (modIds.size() == 0) { ICrashCallable callable = new CallableSuppConfig(); FMLCommonHandler.instance().registerCrashCallable(callable); + } else { + ICrashCallable callable = new CallableUnsuppConfig(modIds); + FMLCommonHandler.instance().registerCrashCallable(callable); } } diff --git a/src/tconstruct/util/config/PHConstruct.java b/src/tconstruct/util/config/PHConstruct.java index 617c5c3c..29bbb22a 100644 --- a/src/tconstruct/util/config/PHConstruct.java +++ b/src/tconstruct/util/config/PHConstruct.java @@ -385,8 +385,6 @@ public class PHConstruct Configuration gtConfig = new Configuration(gtDyn); gtConfig.load(); gregtech = gtConfig.get("smelting", "tile.anvil.slightlyDamaged", false).getBoolean(false); - TConstruct.logger - .severe("Gelatinous iceberg dead ahead! Entering Greggy waters! Abandon hope all ye who enter here! (No, seriously, we don't support GT. Don't report any issues. Thanks.)"); } }