Class InventoryGUI

Object
InventoryGUI

public class InventoryGUI extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    InventoryGUI​(String id, String title)
    Constructs a new InventoryGUI with an ID and a title
    InventoryGUI​(String id, String title, int rowAmount)
    Constructs a new InventoryGUI with an ID, title and row amount
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    fill​(ItemStack item)
    Fills the inventory with the given ItemStack
    getButtonID​(int slot)
    Gets the ID of the button in the given slot
    Inventory
    Gets the inventory of the InventoryGUI
    boolean
    isButton​(int slot)
    Check if the given slot is a button
    void
    open​(OfflinePlayer p)
    Opens the inventory to the given player
    void
    setButton​(String id, int slot, ItemStack button)
    Sets a button into the InventoryGUI
    void
    setColumn​(int column, ItemStack item)
    Fills the given column with the given ItemStack
    void
    setIntersected​(ItemStack item1, ItemStack item2)
    Fill the inventory with the given items in an intersected shape
    void
    setRow​(int row, ItemStack item)
    Fills the given row with the given ItemStack

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InventoryGUI

      public InventoryGUI(String id, String title)
      Constructs a new InventoryGUI with an ID and a title
      Parameters:
      id - Inventory ID
      title - Title of the inventory
    • InventoryGUI

      public InventoryGUI(String id, String title, int rowAmount)
      Constructs a new InventoryGUI with an ID, title and row amount
      Parameters:
      id - ID of the inventory
      title - Title of the inventory
      rowAmount - Rows of the inventory
  • Method Details

    • open

      public void open(OfflinePlayer p)
      Opens the inventory to the given player
      Parameters:
      p - Player to open inventory to
      See Also:
      Player
    • setButton

      public void setButton(String id, int slot, ItemStack button)
      Sets a button into the InventoryGUI
      Parameters:
      id - ID of the button
      slot - Slot in which the button must go
      button - ItemStack of the button
      See Also:
      ItemStack
    • setColumn

      public void setColumn(int column, ItemStack item)
      Fills the given column with the given ItemStack
      Parameters:
      column - Number of the column
      item - ItemStack with which to be filled
      See Also:
      ItemStack
    • setIntersected

      public void setIntersected(ItemStack item1, ItemStack item2)
      Fill the inventory with the given items in an intersected shape
      Parameters:
      item1 - ItemStack in the first slot
      item2 - ItemStack in the second slot
      See Also:
      ItemStack
    • setRow

      public void setRow(int row, ItemStack item)
      Fills the given row with the given ItemStack
      Parameters:
      row - Number of row
      item - ItemStack with which to be filled
      See Also:
      ItemStack
    • fill

      public void fill(ItemStack item)
      Fills the inventory with the given ItemStack
      Parameters:
      item - ItemStack with which to be filled
      See Also:
      ItemStack
    • getInventory

      public Inventory getInventory()
      Gets the inventory of the InventoryGUI
      Returns:
      The inventory of the InventoryGUI
      See Also:
      Inventory
    • getButtonID

      public String getButtonID(int slot)
      Gets the ID of the button in the given slot
      Parameters:
      slot - Slot of the button
      Returns:
      The ID of the button
    • isButton

      public boolean isButton(int slot)
      Check if the given slot is a button
      Parameters:
      slot - Slot of the possible button
      Returns:
      True if the slot is a button