Interface IComponentsWrapper

All Known Subinterfaces:
IComponentsScrollableWrapper, ICustomGui

public interface IComponentsWrapper
  • Method Details

    • addButton

      IButton addButton(int id, String label, int x, int y)
      Add a regular, Minecraft style button to this GUI. Uses default width and height.
      Parameters:
      id - - Unique ID for identifying this button.
      label - - String to display on this button.
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
    • addButton

      IButton addButton(int id, String label, int x, int y, int width, int height)
      Add a regular, Minecraft style button to this GUI, with a defined width and height.
      Parameters:
      id - - Unique ID for identifying this button.
      label - - String to display on this button.
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      width - - Width of this button.
      height - - Height of this button.
    • addButtonList

      IButtonList addButtonList(int id, int x, int y, int width, int height)
      Add a button which can cycle through values.
      Parameters:
      id - - Unique ID for identifying this button.
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      width - - Width of this button.
      height - - Height of this button.
    • addTexturedButton

      IButton addTexturedButton(int id, String label, int x, int y, int width, int height, String texture)
      Add a button with a custom texture to this GUI. Hover Texture is taken from directly beneath the base texture. For examples, look at Vanilla Minecraft button textures.
      Parameters:
      id - - Unique ID for identifying this button.
      label - - String to display on this button.
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      width - - Width of this button and texture.
      height - - Height of this button and texture.
      texture - - Resource Location of the texture to use. (For Example: "minecraft:textures/gui/widgets.png")
    • addTexturedButton

      IButton addTexturedButton(int id, String label, int x, int y, int width, int height, String texture, int textureX, int textureY)
      Add a button with a custom texture to this GUI, with a texture offset. Hover Texture is taken from directly beneath the base texture. For examples, look at Vanilla Minecraft button textures.
      Parameters:
      id - - Unique ID for identifying this button.
      label - - String to display on this button.
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      width - - Width of this button and texture.
      height - - Height of this button and texture.
      texture - - Resource Location of the texture to use. (For Example: "minecraft:textures/gui/widgets.png")
      textureX - - X offset of the desired texture within the defined texture file. Should refer to the Top-Left of the desired texture.
      textureY - - Y offset of the desired texture within the defined texture file. Should refer to the Top-Left of the desired texture.
    • addLabel

      ILabel addLabel(int id, String label, int x, int y, int width, int height)
      Add a OverlayLabelComponent to the GUI.
      Parameters:
      id - - Unique ID for identifying this label.
      label - - String to display.
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      width - - Width of this label. (Does Not Change the font size.)
      height - - Height of this label. (Does Not Change the font size.)
    • addLabel

      ILabel addLabel(int id, String label, int x, int y, int width, int height, int color)
      Add a OverlayLabelComponent to the GUI.
      Parameters:
      id - - Unique ID for identifying this label.
      label - - String to display.
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      width - - Width of this label. (Does Not Change the font size.)
      height - - Height of this label. (Does Not Change the font size.)
      color - - Color to be applied;
    • addTextField

      ITextField addTextField(int id, int x, int y, int width, int height)
      Add a Text Field input to the GUI, that the player can type into.
      Parameters:
      id - - Unique ID for identifying this label.
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      width - - Width of this Text Field.
      height - - Height of this Text Field.
    • addTextArea

      ITextArea addTextArea(int id, int x, int y, int width, int height)
      Add a Text Field input to the GUI, that the player can type into.
      Parameters:
      id - - Unique ID for identifying this label.
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      width - - Width of this Text Field.
      height - - Height of this Text Field.
    • addScroll

      IScroll addScroll(int id, int x, int y, int width, int height, String[] list)
      Add a Scroll List to the GUI, for the player to select from.
      Parameters:
      id - - Unique ID for identifying this scroll.
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      width - - Width of the Scroll List.
      height - - Height of the Scroll List.
      list - - List of String options for the player to choose from.
    • addSlider

      ISlider addSlider(int id, int x, int y, int width, int height, String format)
      Add a Scroll List to the GUI, for the player to select from.
      Parameters:
      id - - Unique ID for identifying this scroll.
      format - - String format for display
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      width - - Width of the Scroll List.
      height - - Height of the Scroll List.
    • addEntityDisplay

      IEntityDisplay addEntityDisplay(int id, int x, int y, IEntity entity)
      Add an entity display
      Parameters:
      id - - Unique ID for identifying this component.
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      entity - - Entity for display
    • addColoredLine

      IColoredLine addColoredLine(int id, int xStart, int yStart, int xEnd, int yEnd, int color, float thickness)
      Add a colored line
      Parameters:
      id - - Unique ID for identifying this component.
      xStart - - Start X Position, relative to the Left side of the GUI window.
      yStart - - Start Y Position, relative to the Top of the GUI window.
      xEnd - - End X Position, relative to the Left side of the GUI window.
      yEnd - - End Y Position, relative to the Top of the GUI window.
      color - - Color in RGBA format
      thickness - - Line thickness in pixels
    • addItemRenderer

      IItemRenderer addItemRenderer(int id, int x, int y, int width, int height, IItemStack stack)
      Add an ItemRenderer
      Parameters:
      id - - Unique ID for identifying this component.
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      width - - Width of the ItemRenderer hover box.
      height - - Height of the ItemRenderer hover box.
      stack - - ItemStack to display
    • addAssetsSelector

      IAssetsSelector addAssetsSelector(int id, int x, int y, int width, int height)
      Add a Scroll List to the GUI, for the player to select from.
      Parameters:
      id - - Unique ID for identifying this component.
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      width - - Width of the component.
      height - - Height of the component.
    • addTexturedRect

      ITexturedRect addTexturedRect(int id, String texture, int x, int y, int width, int height)
      Add a texture to be drawn within the GUI.
      Parameters:
      id - - Unique ID for identifying this texture.
      texture - - Resource Location of the texture to use. (For Example: "minecraft:textures/gui/widgets.png")
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      width - - Width of the texture.
      height - - Height of the texture.
    • addTexturedRect

      ITexturedRect addTexturedRect(int id, String texture, int x, int y, int width, int height, int textureX, int textureY)
      Add a texture to be drawn within the GUI.
      Parameters:
      id - - Unique ID for identifying this texture.
      texture - - Resource Location of the texture to use. (For Example: "minecraft:textures/gui/widgets.png")
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      width - - Width of the texture.
      height - - Height of the texture.
      textureX - - X offset of the desired texture within the defined texture file. Should refer to the Top-Left of the desired texture.
      textureY - - Y offset of the desired texture within the defined texture file. Should refer to the Top-Left of the desired texture.
    • getComponents

      List<ICustomGuiComponent> getComponents()
    • getComponent

      ICustomGuiComponent getComponent(int id)
      Get a component from this GUI by it's ID.
      Parameters:
      id - - Component ID to match.
      Returns:
      First ICustomGuiComponent with a matching ID, otherwise null.
    • addComponent

      void addComponent(ICustomGuiComponent button)
    • removeComponent

      void removeComponent(int id)
      Remove component from this GUI by it's ID.
      Parameters:
      id - - Component ID to match.
    • getSlots

      List<IItemSlot> getSlots()
    • getPlayerSlots

      List<IItemSlot> getPlayerSlots()
    • addItemSlot

      IItemSlot addItemSlot(int x, int y)
      Add an Item Slot to the GUI. CAUTION: Handling Item Storage can be complicated. Once the GUI closes, any items in it will be lost unless you handle storing/saving this information yourself.
      Parameters:
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
    • addItemSlot

      IItemSlot addItemSlot(int x, int y, IItemStack stack)
      Add an Item Slot to the GUI with an IItemStack already in it. CAUTION: Handling Item Storage can be complicated. Once the GUI closes, any items in it will be lost unless you handle storing/saving this information yourself.
      Parameters:
      x - - X Position, relative to the Left side of the GUI window.
      y - - Y Position, relative to the Top of the GUI window.
      stack - - IItemStack to be in this slot upon opening the GUI.
    • removeItemSlot

      void removeItemSlot(IItemSlot slot)
    • showPlayerInventory

      @Deprecated void showPlayerInventory(int x, int y)
      Deprecated.
    • showPlayerInventory

      IItemSlot[] showPlayerInventory(int x, int y, boolean full)
      Add a display of the Player's Inventory to the GUI. A Player's inventory is around 162 Wide, and 58 Tall. Take this into consideration when placing this.
      Parameters:
      x - - X Position of the Top-Left corner, relative to the Left side of the GUI window.
      y - - Y Position of the Top-Left corner, relative to the Top of the GUI window.
      full - - Show the full inventory or just the hotbar