Add in the ability for a client to throw a custom exception that displays a custom gui instead of the default error message.

This commit is contained in:
Christian committed 2012-10-16 12:39:04 -04:00
1 parent e17f2677c7
commit 887aa277a4
10 files changed
+165 -6

No files matched your search

@@ -107,6 +107,8 @@ public class FMLClientHandler implements IFMLSidedHandler
private WrongMinecraftVersionException wrongMC;
private CustomModLoadingErrorDisplayException customError;
/**
* Called to start the whole game off from
* {@link MinecraftServer#startServer}
@@ -153,6 +155,11 @@ public class FMLClientHandler implements IFMLSidedHandler
{
modsMissing = missing;
}
catch (CustomModLoadingErrorDisplayException custom)
{
FMLLog.log(Level.SEVERE, custom, "A custom exception was thrown by a mod, the game will now halt");
customError = custom;
}
catch (LoaderException le)
{
haltGame("There was a severe problem during mod loading that has caused the game to fail", le);
@@ -182,6 +189,12 @@ public class FMLClientHandler implements IFMLSidedHandler
{
Loader.instance().initializeMods();
}
catch (CustomModLoadingErrorDisplayException custom)
{
FMLLog.log(Level.SEVERE, custom, "A custom exception was thrown by a mod, the game will now halt");
customError = custom;
return;
}
catch (LoaderException le)
{
haltGame("There was a severe problem during mod loading that has caused the game to fail", le);
@@ -204,6 +217,10 @@ public class FMLClientHandler implements IFMLSidedHandler
{
client.func_71373_a(new GuiModsMissing(modsMissing));
}
else if (customError != null)
{
client.func_71373_a(new GuiCustomModLoadingErrorScreen(customError));
}
else
{
TextureFXManager.instance().loadTextures(client.field_71418_C.func_77292_e());