mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-27 15:33:18 +00:00
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:
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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user