Class GuiContainer

    • Field Detail

      • inventoryBackground

        protected static final ResourceLocation inventoryBackground
        + The location of the inventory background texture
      • xSize

        protected int xSize
        + The X size of the inventory window in pixels.
      • ySize

        protected int ySize
        + The Y size of the inventory window in pixels.
      • inventorySlots

        public Container inventorySlots
      • guiLeft

        protected int guiLeft
      • guiTop

        protected int guiTop
      • dragSplittingSlots

        protected final java.util.Set<Slot> dragSplittingSlots
      • dragSplitting

        protected boolean dragSplitting
    • Constructor Detail

      • GuiContainer

        public GuiContainer​(Container inventorySlotsIn)
    • Method Detail

      • initGui

        public void initGui()
        + Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the window resizes, the buttonList is cleared beforehand.
        Overrides:
        initGui in class GuiScreen
      • drawScreen

        public void drawScreen​(int i,
                               int j,
                               float f)
        + Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
        Overrides:
        drawScreen in class GuiScreen
      • drawGuiContainerForegroundLayer

        protected void drawGuiContainerForegroundLayer​(int mouseX,
                                                       int mouseY)
        + Draw the foreground layer for the GuiContainer (everything in front of the items). Args : mouseX, mouseY
      • drawGuiContainerBackgroundLayer

        protected abstract void drawGuiContainerBackgroundLayer​(float var1,
                                                                int var2,
                                                                int var3)
      • mouseClicked

        protected void mouseClicked​(int parInt1,
                                    int parInt2,
                                    int parInt3)
        + Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
        Overrides:
        mouseClicked in class GuiScreen
      • mouseClickMove

        protected void mouseClickMove​(int i,
                                      int j,
                                      int k,
                                      long var4)
        + Called when a mouse button is pressed and the mouse is moved around. Parameters are : mouseX, mouseY, lastButtonClicked & timeSinceMouseClick.
        Overrides:
        mouseClickMove in class GuiScreen
      • mouseReleased

        protected void mouseReleased​(int i,
                                     int j,
                                     int k)
        + Called when a mouse button is released. Args : mouseX, mouseY, releaseButton
        Overrides:
        mouseReleased in class GuiScreen
      • isPointInRegion

        protected boolean isPointInRegion​(int left,
                                          int top,
                                          int right,
                                          int bottom,
                                          int pointX,
                                          int pointY)
        + Test if the 2D point is in a rectangle (relative to the GUI). Args : rectX, rectY, rectWidth, rectHeight, pointX, pointY
      • handleMouseClick

        protected void handleMouseClick​(Slot slotIn,
                                        int slotId,
                                        int clickedButton,
                                        int clickType)
        + Called when the mouse is clicked over a slot or outside the gui.
      • keyTyped

        protected void keyTyped​(char parChar1,
                                int parInt1)
        + Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
        Overrides:
        keyTyped in class GuiScreen
      • checkHotbarKeys

        protected boolean checkHotbarKeys​(int keyCode)
        + This function is what controls the hotbar shortcut check when you press a number key when hovering a stack. Args : keyCode, Returns true if a Hotbar key is pressed, else false
      • onGuiClosed

        public void onGuiClosed()
        + Called when the screen is unloaded. Used to disable keyboard repeat events
        Overrides:
        onGuiClosed in class GuiScreen
      • doesGuiPauseGame

        public boolean doesGuiPauseGame()
        + Returns true if this GUI should pause the game when it is displayed in single-player
        Overrides:
        doesGuiPauseGame in class GuiScreen
      • updateScreen

        public void updateScreen()
        + Called from the main game loop to update the screen.
        Overrides:
        updateScreen in class GuiScreen