public abstract class GuiBase<T extends net.minecraft.inventory.container.Container>
extends net.minecraft.client.gui.screen.inventory.ContainerScreen<T>
Modifier and Type | Field and Description |
---|---|
protected java.util.List<BaseComponent> |
components |
protected GuiTabCollection |
leftTabs |
protected GuiTabCollection |
rightTabs |
net.minecraft.util.ResourceLocation |
textureLocation |
protected GuiComponentText |
titleComponent |
container, dragSplitting, dragSplittingSlots, guiLeft, guiTop, hoveredSlot, INVENTORY_BACKGROUND, playerInventory, slotColor, xSize, ySize
Constructor and Description |
---|
GuiBase(T inventory,
net.minecraft.entity.player.PlayerInventory playerInventory,
net.minecraft.util.text.ITextComponent title,
int width,
int height,
net.minecraft.util.ResourceLocation texture)
Main constructor for Guis
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addComponents()
This will be called after the GUI has been initialized and should be where you add all components.
|
protected void |
addLeftTabs(GuiTabCollection tabs)
Add the tabs to the left.
|
protected void |
addRightTabs(GuiTabCollection tabs)
Adds the tabs to the right.
|
boolean |
charTyped(char typedChar,
int keyCode)
Called when a key is typed
|
protected void |
drawGuiContainerBackgroundLayer(float partialTicks,
int mouseX,
int mouseY)
Called to draw the background
Usually used to create the base on which to render things
|
protected void |
drawGuiContainerForegroundLayer(int mouseX,
int mouseY)
Used to draw above the background.
|
void |
drawTopLayer(int mouseX,
int mouseY)
The main draw call.
|
java.util.List<java.awt.Rectangle> |
getCoveredAreas()
Returns a list of Rectangles that represent the areas covered by the GUI
|
int |
getGuiLeft()
Used to get the guiLeft
|
int |
getGuiTop()
Used to get guiTop
|
int |
getXSize()
For some reason this isn't in vanilla
|
int |
getYSize()
For some reason this isn't in vanilla
|
boolean |
mouseClicked(double mouseX,
double mouseY,
int mouseButton)
Called when the mouse is clicked
|
boolean |
mouseDragged(double mouseX,
double mouseY,
int clickedMouseButton,
double xDragAmount,
double yDragAmount)
Used to track when the mouse is clicked and dragged
|
boolean |
mouseReleased(double mouseX,
double mouseY,
int state)
Called when the mouse releases a button
|
boolean |
mouseScrolled(double mouseX,
double mouseY,
double mouseDelta)
Handle the mouse input
|
func_195363_d, getContainer, getSlotColor, getSlotUnderMouse, handleMouseClick, hasClickedOutside, init, isPauseScreen, isPointInRegion, keyPressed, removed, render, renderHoveredToolTip, shouldCloseOnEsc, tick
addButton, children, getMinecraft, getNarrationMessage, getTitle, getTooltipFromItem, handleComponentClicked, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, onClose, renderBackground, renderBackground, renderComponentHoverEffect, renderDirtBackground, renderTooltip, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, setSize, wrapScreenError
getFocused, isDragging, setDragging, setFocused
blit, blit, blit, blit, blit, drawCenteredString, drawRightAlignedString, drawString, fill, fillGradient, hLine, innerBlit, vLine
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected GuiComponentText titleComponent
public net.minecraft.util.ResourceLocation textureLocation
protected java.util.List<BaseComponent> components
protected GuiTabCollection rightTabs
protected GuiTabCollection leftTabs
public GuiBase(T inventory, net.minecraft.entity.player.PlayerInventory playerInventory, net.minecraft.util.text.ITextComponent title, int width, int height, net.minecraft.util.ResourceLocation texture)
inventory
- The containerwidth
- The width of the guiheight
- The height of the guititle
- The title of the guitexture
- The location of the background textureprotected abstract void addComponents()
protected void addRightTabs(GuiTabCollection tabs)
tabs
- List of tabs, put GuiTabs inprotected void addLeftTabs(GuiTabCollection tabs)
tabs
- List of tabs, put GuiReverseTabs inpublic boolean mouseClicked(double mouseX, double mouseY, int mouseButton)
mouseClicked
in interface net.minecraft.client.gui.IGuiEventListener
mouseClicked
in interface net.minecraft.client.gui.INestedGuiEventHandler
mouseClicked
in class net.minecraft.client.gui.screen.inventory.ContainerScreen<T extends net.minecraft.inventory.container.Container>
mouseX
- The X PositionmouseY
- The Y PositionmouseButton
- The button pressedpublic boolean mouseReleased(double mouseX, double mouseY, int state)
mouseReleased
in interface net.minecraft.client.gui.IGuiEventListener
mouseReleased
in interface net.minecraft.client.gui.INestedGuiEventHandler
mouseReleased
in class net.minecraft.client.gui.screen.inventory.ContainerScreen<T extends net.minecraft.inventory.container.Container>
mouseX
- The X PositionmouseY
- The Y Positionstate
- The button releasedpublic boolean mouseDragged(double mouseX, double mouseY, int clickedMouseButton, double xDragAmount, double yDragAmount)
mouseDragged
in interface net.minecraft.client.gui.IGuiEventListener
mouseDragged
in interface net.minecraft.client.gui.INestedGuiEventHandler
mouseDragged
in class net.minecraft.client.gui.screen.inventory.ContainerScreen<T extends net.minecraft.inventory.container.Container>
mouseX
- The Current X PositionmouseY
- The Current Y PositionclickedMouseButton
- The button being draggedpublic boolean mouseScrolled(double mouseX, double mouseY, double mouseDelta)
public boolean charTyped(char typedChar, int keyCode)
typedChar
- The letter pressed, as a charkeyCode
- The Java key codeprotected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
drawGuiContainerForegroundLayer
in class net.minecraft.client.gui.screen.inventory.ContainerScreen<T extends net.minecraft.inventory.container.Container>
mouseX
- The mouse X PositionmouseY
- The mouse Y Positionprotected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
drawGuiContainerBackgroundLayer
in class net.minecraft.client.gui.screen.inventory.ContainerScreen<T extends net.minecraft.inventory.container.Container>
partialTicks
- partial ticksmouseX
- The mouse XmouseY
- The mouse Ypublic void drawTopLayer(int mouseX, int mouseY)
mouseX
- The Mouse X PositionmouseY
- The mouse Y Positionpublic int getGuiLeft()
getGuiLeft
in class net.minecraft.client.gui.screen.inventory.ContainerScreen<T extends net.minecraft.inventory.container.Container>
public int getGuiTop()
getGuiTop
in class net.minecraft.client.gui.screen.inventory.ContainerScreen<T extends net.minecraft.inventory.container.Container>
public int getXSize()
getXSize
in class net.minecraft.client.gui.screen.inventory.ContainerScreen<T extends net.minecraft.inventory.container.Container>
public int getYSize()
getYSize
in class net.minecraft.client.gui.screen.inventory.ContainerScreen<T extends net.minecraft.inventory.container.Container>
public java.util.List<java.awt.Rectangle> getCoveredAreas()