public abstract class MalisisGui
extends net.minecraft.client.gui.GuiScreen
| Modifier and Type | Field and Description |
|---|---|
static GuiTexture |
BLOCK_TEXTURE |
static boolean |
cancelClose
Whether or not to cancel the next gui close event.
|
protected boolean |
constructed
Whether this GUI has been constructed.
|
protected UIComponent |
focusedComponent
Currently focused child component.
|
protected boolean |
guiscreenBackground
Determines if the screen should be darkened when the GUI is opened.
|
protected UIComponent |
hoveredComponent
Currently hovered child component.
|
protected MalisisInventoryContainer |
inventoryContainer
Inventory container that handles the inventories and slots actions.
|
static GuiTexture |
ITEM_TEXTURE |
protected java.util.Set<IKeyListener> |
keyListeners
List of
IKeyListener registered. |
protected long |
lastClickButton
Last clicked button
|
protected long |
lastClickTime
How long since last click.
|
protected int |
lastMouseX
Last known position of the mouse.
|
protected int |
lastMouseY
Last known position of the mouse.
|
protected GuiRenderer |
renderer
Renderer drawing the components.
|
| Modifier | Constructor and Description |
|---|---|
protected |
MalisisGui() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addToScreen(UIComponent component)
Adds container to the screen.
|
void |
animate(Animation animation) |
void |
animate(Animation animation,
int delay) |
void |
clearScreen()
Removes all the components from the screen
|
void |
close()
Closes this
MalisisGui. |
abstract void |
construct()
Called before display() if this
MalisisGui is not constructed yet. |
static MalisisGui |
currentGui()
Gets the current
MalisisGui displayed. |
static <T extends MalisisGui> |
currentGui(java.lang.Class<T> type)
Gets the current
MalisisGui of the specified type displayed. |
void |
display()
Displays this
MalisisGui. |
void |
display(boolean cancelClose)
Display this
MalisisGui. |
boolean |
doesGuiPauseGame() |
void |
drawScreen(int mouseX,
int mouseY,
float partialTicks)
Draws this
MalisisGui. |
UIComponent |
getComponentAt(int x,
int y)
Gets the
UIContainer at the specified coordinates inside this MalisisGui. |
long |
getElapsedTime()
Gets elapsed time since the GUI was opened.
|
static UIComponent |
getFocusedComponent()
Gets the currently focused
UIComponent |
MalisisFont |
getFont()
Gets the defaut
MalisisFont used by the GuiRenderer. |
FontRenderOptions |
getFontRenderOptions()
Gets the default
FontRenderOptions used by the GuiRenderer. |
GuiTexture |
getGuiTexture()
Gets the default
GuiTexture used by the GuiRenderer. |
static UIComponent |
getHoveredComponent() |
MalisisInventoryContainer |
getInventoryContainer()
Gets the
MalisisInventoryContainer for this MalisisGui. |
GuiRenderer |
getRenderer()
Gets the
GuiRenderer for this MalisisGui. |
void |
handleMouseInput()
Called every frame to handle mouse input.
|
static boolean |
isGuiCloseKey(int keyCode) |
protected void |
keyTyped(char keyChar,
int keyCode)
Called when a key is pressed on the keyboard.
|
protected void |
mouseClicked(int x,
int y,
int button)
Called when a mouse button is pressed down.
|
protected void |
mouseClickMove(int x,
int y,
int button,
long timer)
Called when the mouse is moved while a button is pressed.
|
protected void |
mouseReleased(int x,
int y,
int button)
Called when a mouse button is released.
|
void |
onGuiClosed() |
static void |
playSound(java.lang.String name) |
static void |
playSound(java.lang.String name,
float level) |
void |
registerKeyListener(IKeyListener listener)
Registers a
IKeyListener that will always receive keys types, even when not focused or hovered. |
static void |
sendAction(MalisisInventoryContainer.ActionType action,
MalisisSlot slot,
int code)
Sends a GUI action to the server.
|
static boolean |
setFocusedComponent(UIComponent component,
boolean focused) |
static boolean |
setHoveredComponent(UIComponent component,
boolean hovered)
Sets the hovered state for a
UIComponent. |
void |
setInventoryContainer(MalisisInventoryContainer container)
Sets the
MalisisInventoryContainer for this MalisisGui. |
void |
setWorldAndResolution(net.minecraft.client.Minecraft minecraft,
int width,
int height)
Called when game resolution changes.
|
void |
unregisterKeyListener(IKeyListener listener)
Unregisters a previously registered IKeyListener.
|
void |
update(int mouseX,
int mouseY,
float partialTick)
Called every frame.
|
void |
updateGui()
Called from TE when TE is updated.
|
actionPerformed, confirmClicked, drawBackground, drawCreativeTabHoveringText, drawDefaultBackground, drawHoveringText, drawHoveringText, drawWorldBackground, getClipboardString, handleInput, handleKeyboardInput, initGui, isCtrlKeyDown, isShiftKeyDown, renderToolTip, setClipboardString, updateScreenpublic static GuiTexture BLOCK_TEXTURE
public static GuiTexture ITEM_TEXTURE
public static boolean cancelClose
protected GuiRenderer renderer
protected boolean guiscreenBackground
protected int lastMouseX
protected int lastMouseY
protected long lastClickButton
protected long lastClickTime
protected MalisisInventoryContainer inventoryContainer
protected UIComponent hoveredComponent
protected UIComponent focusedComponent
protected boolean constructed
protected java.util.Set<IKeyListener> keyListeners
IKeyListener registered.public abstract void construct()
MalisisGui is not constructed yet.public GuiRenderer getRenderer()
GuiRenderer for this MalisisGui.public void setInventoryContainer(MalisisInventoryContainer container)
MalisisInventoryContainer for this MalisisGui.container - the inventory containerpublic MalisisInventoryContainer getInventoryContainer()
MalisisInventoryContainer for this MalisisGui.public GuiTexture getGuiTexture()
GuiTexture used by the GuiRenderer.public MalisisFont getFont()
MalisisFont used by the GuiRenderer.public FontRenderOptions getFontRenderOptions()
FontRenderOptions used by the GuiRenderer.public long getElapsedTime()
protected void addToScreen(UIComponent component)
component - the componentpublic void clearScreen()
public void registerKeyListener(IKeyListener listener)
IKeyListener that will always receive keys types, even when not focused or hovered.listener - the listenerpublic void unregisterKeyListener(IKeyListener listener)
listener - the listenerpublic UIComponent getComponentAt(int x, int y)
UIContainer at the specified coordinates inside this MalisisGui.x - the x coordinatey - the y coordinatescreenpublic void handleMouseInput()
handleMouseInput in class net.minecraft.client.gui.GuiScreenprotected void mouseClicked(int x,
int y,
int button)
mouseClicked in class net.minecraft.client.gui.GuiScreenprotected void mouseClickMove(int x,
int y,
int button,
long timer)
mouseClickMove in class net.minecraft.client.gui.GuiScreenprotected void mouseReleased(int x,
int y,
int button)
mouseReleased in class net.minecraft.client.gui.GuiScreenprotected void keyTyped(char keyChar,
int keyCode)
keyTyped in class net.minecraft.client.gui.GuiScreenpublic void setWorldAndResolution(net.minecraft.client.Minecraft minecraft,
int width,
int height)
setWorldAndResolution in class net.minecraft.client.gui.GuiScreenpublic void drawScreen(int mouseX,
int mouseY,
float partialTicks)
MalisisGui.drawScreen in class net.minecraft.client.gui.GuiScreenpublic void update(int mouseX,
int mouseY,
float partialTick)
mouseX - the mouse xmouseY - the mouse ypartialTick - the partial tickpublic void updateGui()
public void animate(Animation animation)
public void animate(Animation animation, int delay)
public boolean doesGuiPauseGame()
doesGuiPauseGame in class net.minecraft.client.gui.GuiScreenpublic void display()
MalisisGui.public void display(boolean cancelClose)
MalisisGui.cancelClose - the wether or not to cancel the next Gui close event (used for when the GUI is opened from command)public void close()
MalisisGui.public void onGuiClosed()
onGuiClosed in class net.minecraft.client.gui.GuiScreenpublic static MalisisGui currentGui()
MalisisGui displayed.MalisisGuipublic static <T extends MalisisGui> T currentGui(java.lang.Class<T> type)
MalisisGui of the specified type displayed.T - the generic typetype - the typepublic static void sendAction(MalisisInventoryContainer.ActionType action, MalisisSlot slot, int code)
action - the actionslot - the slotcode - the keyboard codepublic static UIComponent getHoveredComponent()
UIComponent. null if there is no current GUI.public static boolean setHoveredComponent(UIComponent component, boolean hovered)
UIComponent. If a UIComponent is currently hovered, it will be "unhovered" first.component - the component that gets his state changedhovered - the hovered statepublic static UIComponent getFocusedComponent()
UIComponentpublic static boolean setFocusedComponent(UIComponent component, boolean focused)
public static void playSound(java.lang.String name)
public static void playSound(java.lang.String name,
float level)
public static boolean isGuiCloseKey(int keyCode)