001/*
002 * Forge Mod Loader
003 * Copyright (c) 2012-2013 cpw.
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser Public License v2.1
006 * which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
008 * 
009 * Contributors:
010 *     cpw - implementation
011 */
012
013package cpw.mods.fml.client;
014
015import net.minecraft.client.gui.FontRenderer;
016import net.minecraft.client.gui.GuiErrorScreen;
017import cpw.mods.fml.common.IFMLHandledException;
018import cpw.mods.fml.relauncher.Side;
019import cpw.mods.fml.relauncher.SideOnly;
020
021/**
022 * If a mod throws this exception during loading, it will be called back to render
023 * the error screen through the methods below. This error will not be cleared, and will
024 * not allow the game to carry on, but might be useful if your mod wishes to report
025 * a fatal configuration error in a pretty way.
026 *
027 * Throw this through a proxy. It won't work on the dedicated server environment.
028 * @author cpw
029 *
030 */
031@SideOnly(Side.CLIENT)
032public abstract class CustomModLoadingErrorDisplayException extends RuntimeException implements IFMLHandledException
033{
034    /**
035     * Called after the GUI is inited by the parent code. You can do extra stuff here, maybe?
036     *
037     * @param errorScreen The error screen we're painting
038     * @param fontRenderer A font renderer for you
039     */
040    public abstract void initGui(GuiErrorScreen errorScreen, FontRenderer fontRenderer);
041
042    /**
043     * Draw your error to the screen.
044     *
045     * <br/><em>Warning: Minecraft is in a deep error state.</em> <strong>All</strong> it can do is stop.
046     * Do not try and do anything involving complex user interaction here.
047     *
048     * @param errorScreen The error screen to draw to
049     * @param fontRenderer A font renderer for you
050     * @param mouseRelX Mouse X
051     * @param mouseRelY Mouse Y
052     * @param tickTime tick time
053     */
054    public abstract void drawScreen(GuiErrorScreen errorScreen, FontRenderer fontRenderer, int mouseRelX, int mouseRelY, float tickTime);
055}