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 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 |
GuiTexture |
getGuiTexture() |
static UIComponent |
getHoveredComponent() |
MalisisInventoryContainer |
getInventoryContainer()
Gets the
MalisisInventoryContainer 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 |
mouseMovedOrUp(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) |
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 |
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, drawWorldBackground, func_146283_a, getClipboardString, handleInput, handleKeyboardInput, initGui, isCtrlKeyDown, isShiftKeyDown, renderToolTip, setClipboardString, updateScreen
public 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
public abstract void construct()
MalisisGui
is not constructed yet.public void setInventoryContainer(MalisisInventoryContainer container)
MalisisInventoryContainer
for this MalisisGui
.container
- the inventory containerpublic MalisisInventoryContainer getInventoryContainer()
MalisisInventoryContainer
for this MalisisGui
.public GuiTexture getGuiTexture()
public long getElapsedTime()
protected void addToScreen(UIComponent component)
component
- the componentpublic void clearScreen()
public UIComponent getComponentAt(int x, int y)
UIContainer
at the specified coordinates inside this MalisisGui
.x
- the x coordinatey
- the y coordinatescreen
public void handleMouseInput()
handleMouseInput
in class net.minecraft.client.gui.GuiScreen
protected void mouseClicked(int x, int y, int button)
mouseClicked
in class net.minecraft.client.gui.GuiScreen
protected void mouseClickMove(int x, int y, int button, long timer)
mouseClickMove
in class net.minecraft.client.gui.GuiScreen
protected void mouseMovedOrUp(int x, int y, int button)
mouseMovedOrUp
in class net.minecraft.client.gui.GuiScreen
protected void keyTyped(char keyChar, int keyCode)
keyTyped
in class net.minecraft.client.gui.GuiScreen
public void setWorldAndResolution(net.minecraft.client.Minecraft minecraft, int width, int height)
setWorldAndResolution
in class net.minecraft.client.gui.GuiScreen
public void drawScreen(int mouseX, int mouseY, float partialTicks)
MalisisGui
.drawScreen
in class net.minecraft.client.gui.GuiScreen
public 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.GuiScreen
public 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.GuiScreen
public static MalisisGui currentGui()
MalisisGui
displayed.MalisisGui
public 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()
UIComponent
public 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)