Files
TinkersConstruct/src/main/java/tconstruct/util/EnvironmentChecks.java
T

49 lines
1.5 KiB
Java
Raw Normal View History

2013-10-22 20:09:21 +01:00
package tconstruct.util;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.ICrashCallable;
import cpw.mods.fml.common.Loader;
2013-10-22 20:09:21 +01:00
import java.util.ArrayList;
import java.util.List;
import tconstruct.TConstruct;
2013-12-06 16:18:07 +00:00
import mantle.crash.CallableSuppConfig;
import mantle.crash.CallableUnsuppConfig;
2013-12-05 00:29:59 -05:00
2013-11-10 13:57:35 -08:00
public class EnvironmentChecks
{
2013-10-22 20:09:21 +01:00
2013-11-10 13:57:35 -08:00
private EnvironmentChecks()
{
} // Singleton
2013-10-22 20:09:21 +01:00
/**
* Checks for conflicting stuff in environment; adds callable to any crash logs if so.
* Note: This code adds additional data to crashlogs. It does not trigger any crashes.
2013-10-22 20:09:21 +01:00
*/
2013-11-10 13:57:35 -08:00
public static void verifyEnvironmentSanity ()
{
2013-10-30 22:15:03 +00:00
List<String> modIds = new ArrayList<String>();
2013-11-10 13:57:35 -08:00
if (Loader.isModLoaded("gregtech_addon"))
{
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.)");
2013-10-22 20:09:21 +01:00
modIds.add("gregtech_addon");
2013-10-30 22:15:03 +00:00
}
2013-10-22 20:09:21 +01:00
// Bukkit/Magic Launcher/Optifine are caught by Mantle, so we no longer check for those.
2013-11-30 19:50:18 +00:00
2013-11-10 13:57:35 -08:00
if (modIds.size() == 0)
{
2013-12-06 16:18:07 +00:00
ICrashCallable callable = new CallableSuppConfig("TConstruct");
FMLCommonHandler.instance().registerCrashCallable(callable);
2013-11-10 13:57:35 -08:00
}
else
{
2013-12-06 16:18:07 +00:00
ICrashCallable callable = new CallableUnsuppConfig("TConstruct", modIds);
2013-10-30 22:15:03 +00:00
FMLCommonHandler.instance().registerCrashCallable(callable);
2013-10-22 20:09:21 +01:00
}
}
}