Added GuiOpenEvent

You can use this for a clean way to override guis, without needing an
TickHandler to check if the gui you want to override is open and show
your own gui

Proper close check
This commit is contained in:
jk-5 committed 2013-08-24 09:32:34 +02:00
1 parent b2c1eae652
commit f78eba09fd
2 files changed
+76 -11

No files matched your search

@@ -0,0 +1,22 @@
package net.minecraftforge.client.event;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.event.Cancelable;
import net.minecraftforge.event.Event;
/**
* This event is called before any Gui will open.
* If you don't want this to happen, cancel the event.
* If you want to override this Gui, simply set the gui variable to your own Gui.
*
* @author jk-5
*/
@Cancelable
public class GuiOpenEvent extends Event
{
public GuiScreen gui;
public GuiOpenEvent(GuiScreen gui)
{
this.gui = gui;
}
}