public class LayoutManager extends java.lang.Object implements IContainerInputHandler, IContainerTooltipHandler, IContainerDrawHandler, IContainerObjectHandler, KeyManager.IKeyStateTracker
| Modifier and Type | Field and Description |
|---|---|
static Button |
delete |
static Button[] |
deleteButtons |
static SubsetWidget |
dropDown |
static ButtonCycled |
gamemode |
static Button |
heal |
static ItemPanel |
itemPanel |
static java.util.HashMap<java.lang.Integer,LayoutStyle> |
layoutStyles |
static Button |
less |
static Button |
magnet |
static Button |
more |
static Button |
next |
static Button |
options |
static IRecipeOverlayRenderer |
overlayRenderer |
static Label |
pageLabel |
static Button |
prev |
static ItemQuantityField |
quantity |
static Button |
rain |
static TextField |
searchField |
static SaveLoadButton[] |
stateButtons |
static Button[] |
timeButtons |
| Constructor and Description |
|---|
LayoutManager() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkCreativeInv(net.minecraft.client.gui.inventory.GuiContainer gui) |
static void |
drawButtonBackground(int x,
int y,
int w,
int h,
boolean edges,
int type) |
static void |
drawIcon(int x,
int y,
Image image) |
static Widget |
getInputFocused() |
static LayoutStyle |
getLayoutStyle() |
static LayoutStyle |
getLayoutStyle(int id) |
ItemStack |
getStackUnderMouse(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey)
Do not return an item that is handled somewhere else
|
void |
guiTick(net.minecraft.client.gui.inventory.GuiContainer gui)
Called once per tick in the gui.
|
java.util.List<java.lang.String> |
handleItemDisplayName(net.minecraft.client.gui.inventory.GuiContainer gui,
ItemStack stack,
java.util.List<java.lang.String> currenttip)
Use this for modifying the multiline display name of an item which may not necessarily be under the mouse.
|
java.util.List<java.lang.String> |
handleItemTooltip(net.minecraft.client.gui.inventory.GuiContainer gui,
ItemStack itemstack,
int mousex,
int mousey,
java.util.List<java.lang.String> currenttip)
Use this for modifying the tooltips of items that are under the mouse.
|
java.util.List<java.lang.String> |
handleTooltip(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey,
java.util.List<java.lang.String> currenttip)
Use this to add tooltips for other objects.
|
static LayoutManager |
instance() |
boolean |
keyTyped(net.minecraft.client.gui.inventory.GuiContainer gui,
char keyChar,
int keyID)
Only use this for things like input boxes that have to be 'focused' first and will not conflict with others
|
boolean |
lastKeyTyped(net.minecraft.client.gui.inventory.GuiContainer gui,
char keyChar,
int keyID)
This version of keyTyped is called if the key event has not been handled by the first pass, use this for key bindings that work globally
|
static void |
layout(net.minecraft.client.gui.inventory.GuiContainer gui) |
static void |
load() |
void |
load(net.minecraft.client.gui.inventory.GuiContainer gui)
Called when the gui is shown
|
boolean |
mouseClicked(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey,
int button)
Called when the mouse is clicked in the gui
|
boolean |
mouseScrolled(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey,
int scrolled) |
boolean |
objectUnderMouse(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey) |
void |
onKeyTyped(net.minecraft.client.gui.inventory.GuiContainer gui,
char keyChar,
int keyID)
This version of keyTyped is passive and will be called on every input handler before keyTyped is processed
|
void |
onMouseClicked(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey,
int button)
This version of mouseClicked is passive and will be called on every input handler before mouseClicked is processed
|
void |
onMouseDragged(net.minecraft.client.gui.inventory.GuiContainer gui,
int mx,
int my,
int button,
long heldTime)
This version of mouseClicked is passive and will be called on every input handler before mouseClicked is processed
|
void |
onMouseScrolled(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey,
int scrolled)
This version of mouseScrolled is passive and will be called on every input handler before mouseScrolled is processed
|
void |
onMouseUp(net.minecraft.client.gui.inventory.GuiContainer gui,
int mx,
int my,
int button) |
void |
onPreDraw(net.minecraft.client.gui.inventory.GuiContainer gui)
Initialize your objects and the gui for drawing.
|
void |
postRenderObjects(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey)
Use this to draw things that should always be on top, for example objects being held by the mouse.
|
void |
refresh(net.minecraft.client.gui.inventory.GuiContainer gui)
Called when the same gui is reshown.
|
void |
renderObjects(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey)
Draw your objects.
|
void |
renderSlotOverlay(net.minecraft.client.gui.inventory.GuiContainer window,
Slot slot)
Render something over a slot after the item in the slot.
|
void |
renderSlotUnderlay(net.minecraft.client.gui.inventory.GuiContainer gui,
Slot slot)
Render something over a slot before the item in the slot.
|
static void |
setInputFocused(Widget widget) |
boolean |
shouldShowTooltip(net.minecraft.client.gui.inventory.GuiContainer gui) |
void |
tickKeyStates() |
static void |
updateWidgetVisiblities(net.minecraft.client.gui.inventory.GuiContainer gui,
VisiblityData visiblity) |
public static ItemPanel itemPanel
public static SubsetWidget dropDown
public static TextField searchField
public static Button options
public static Button prev
public static Button next
public static Label pageLabel
public static Button more
public static Button less
public static ItemQuantityField quantity
public static SaveLoadButton[] stateButtons
public static Button[] deleteButtons
public static Button delete
public static ButtonCycled gamemode
public static Button rain
public static Button magnet
public static Button[] timeButtons
public static Button heal
public static IRecipeOverlayRenderer overlayRenderer
public static java.util.HashMap<java.lang.Integer,LayoutStyle> layoutStyles
public static void load()
public void onPreDraw(net.minecraft.client.gui.inventory.GuiContainer gui)
IContainerDrawHandleronPreDraw in interface IContainerDrawHandlergui - An instance of the currentscreenpublic void onMouseClicked(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey,
int button)
IContainerInputHandleronMouseClicked in interface IContainerInputHandlergui - An instance of the currentscreenmousex - The x position of the mouse in pixels from leftmousey - The y position of the mouse in pixels from topbutton - The button index being pressed, {0 = Left Click, 1 = Right Click, 2 = Middle Click}public boolean mouseClicked(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey,
int button)
IContainerInputHandlermouseClicked in interface IContainerInputHandlergui - An instance of the currentscreenmousex - The x position of the mouse in pixels from leftmousey - The y position of the mouse in pixels from topbutton - The button index being pressed, {0 = Left Click, 1 = Right Click, 2 = Middle Click}public boolean objectUnderMouse(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey)
objectUnderMouse in interface IContainerObjectHandlergui - An instance of the currentscreenmousex - The x position of the mouse in pixels from leftmousey - The y position of the mouse in pixels from toppublic boolean keyTyped(net.minecraft.client.gui.inventory.GuiContainer gui,
char keyChar,
int keyID)
IContainerInputHandlerkeyTyped in interface IContainerInputHandlergui - An instance of the currentscreenkeyChar - The character representing the keyPresskeyID - The KeyCode as defined in Keyboardpublic void onKeyTyped(net.minecraft.client.gui.inventory.GuiContainer gui,
char keyChar,
int keyID)
IContainerInputHandleronKeyTyped in interface IContainerInputHandlergui - An instance of the currentscreenkeyChar - The character representing the keyPresskeyID - The KeyCode as defined in Keyboardpublic boolean lastKeyTyped(net.minecraft.client.gui.inventory.GuiContainer gui,
char keyChar,
int keyID)
IContainerInputHandlerlastKeyTyped in interface IContainerInputHandlergui - An instance of the currentscreenkeyChar - The character representing the keyPresskeyID - The KeyCode as defined in Keyboardpublic void onMouseUp(net.minecraft.client.gui.inventory.GuiContainer gui,
int mx,
int my,
int button)
onMouseUp in interface IContainerInputHandlergui - An instance of the currentscreenmx - The x position of the mouse in pixels from leftmy - The y position of the mouse in pixels from topbutton - The button index being released, {0 = Left Click, 1 = Right Click, 2 = Middle Click}public void onMouseDragged(net.minecraft.client.gui.inventory.GuiContainer gui,
int mx,
int my,
int button,
long heldTime)
IContainerInputHandleronMouseDragged in interface IContainerInputHandlergui - An instance of the currentscreenmx - The x position of the mouse in pixels from leftmy - The y position of the mouse in pixels from topbutton - The button index being pressed, {0 = Left Click, 1 = Right Click, 2 = Middle Click}heldTime - The number of milliseconds since the button was first pressedpublic ItemStack getStackUnderMouse(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey)
IContainerObjectHandlergetStackUnderMouse in interface IContainerObjectHandlergui - An instance of the currentscreenmousex - The x position of the mouse in pixels from leftmousey - The y position of the mouse in pixels from toppublic void renderObjects(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey)
IContainerDrawHandlerrenderObjects in interface IContainerDrawHandlergui - An instance of the currentscreenmousex - The x position of the mouse in pixels from leftmousey - The y position of the mouse in pixels from toppublic void postRenderObjects(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey)
IContainerDrawHandlerpostRenderObjects in interface IContainerDrawHandlergui - An instance of the currentscreenmousex - The x position of the mouse in pixels from leftmousey - The y position of the mouse in pixels from toppublic java.util.List<java.lang.String> handleTooltip(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey,
java.util.List<java.lang.String> currenttip)
IContainerTooltipHandlerhandleTooltip in interface IContainerTooltipHandlergui - An instance of the currentscreenmousex - The x position of the mouse in pixels from leftmousey - The y position of the mouse in pixels from topcurrenttip - A list of strings, representing each line of the current tooltip as modified by other handlerspublic java.util.List<java.lang.String> handleItemDisplayName(net.minecraft.client.gui.inventory.GuiContainer gui,
ItemStack stack,
java.util.List<java.lang.String> currenttip)
IContainerTooltipHandlerhandleItemDisplayName in interface IContainerTooltipHandlergui - An instance of the currentscreen. If only general information about the item is wanted (Eg. potion effects) then this may be null.stack - The ItemStack under the mousecurrenttip - A list of strings, representing each line of the current tooltip as modified by other handlerspublic java.util.List<java.lang.String> handleItemTooltip(net.minecraft.client.gui.inventory.GuiContainer gui,
ItemStack itemstack,
int mousex,
int mousey,
java.util.List<java.lang.String> currenttip)
IContainerTooltipHandlerhandleItemTooltip in interface IContainerTooltipHandlergui - An instance of the currentscreenitemstack - The ItemStack under the mousecurrenttip - A list of strings, representing each line of the current tooltip as modified by other handlerspublic static void layout(net.minecraft.client.gui.inventory.GuiContainer gui)
public void load(net.minecraft.client.gui.inventory.GuiContainer gui)
IContainerObjectHandlerload in interface IContainerObjectHandlergui - An instance of the currentscreenpublic void refresh(net.minecraft.client.gui.inventory.GuiContainer gui)
IContainerObjectHandlerrefresh in interface IContainerObjectHandlergui - An instance of the currentscreenpublic boolean checkCreativeInv(net.minecraft.client.gui.inventory.GuiContainer gui)
public static void updateWidgetVisiblities(net.minecraft.client.gui.inventory.GuiContainer gui,
VisiblityData visiblity)
public static LayoutStyle getLayoutStyle(int id)
public static LayoutStyle getLayoutStyle()
public void guiTick(net.minecraft.client.gui.inventory.GuiContainer gui)
IContainerObjectHandlerguiTick in interface IContainerObjectHandlergui - An instance of the currentscreenpublic boolean mouseScrolled(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey,
int scrolled)
mouseScrolled in interface IContainerInputHandlergui - An instance of the currentscreenmousex - The x position of the mouse in pixels from leftmousey - The y position of the mouse in pixels from topscrolled - The number of notches scrolled. Positive for up.public void onMouseScrolled(net.minecraft.client.gui.inventory.GuiContainer gui,
int mousex,
int mousey,
int scrolled)
IContainerInputHandleronMouseScrolled in interface IContainerInputHandlergui - An instance of the currentscreenmousex - The x position of the mouse in pixels from leftmousey - The y position of the mouse in pixels from topscrolled - The number of notches scrolled. Positive for up.public boolean shouldShowTooltip(net.minecraft.client.gui.inventory.GuiContainer gui)
shouldShowTooltip in interface IContainerObjectHandlergui - An instance of the currentscreenpublic static Widget getInputFocused()
public static void setInputFocused(Widget widget)
public void renderSlotUnderlay(net.minecraft.client.gui.inventory.GuiContainer gui,
Slot slot)
IContainerDrawHandlerrenderSlotUnderlay in interface IContainerDrawHandlergui - An instance of the currentscreenslot - The slot being rendered.public void renderSlotOverlay(net.minecraft.client.gui.inventory.GuiContainer window,
Slot slot)
IContainerDrawHandlerrenderSlotOverlay in interface IContainerDrawHandlerwindow - An instance of the currentscreenslot - The slot being rendered.public static void drawIcon(int x,
int y,
Image image)
public static void drawButtonBackground(int x,
int y,
int w,
int h,
boolean edges,
int type)
public static LayoutManager instance()
public void tickKeyStates()
tickKeyStates in interface KeyManager.IKeyStateTracker