Class InventoryState

java.lang.Object
me.eddie.inventoryguiapi.gui.session.AbstractAttributable
me.eddie.inventoryguiapi.gui.session.InventoryState
All Implemented Interfaces:
Attributable

public class InventoryState extends AbstractAttributable
Represents the current state of an InventoryGUI page. It keeps track of the currently displayed GUIElements and their positions, the inventory (Bukkit) being currently displayed and it's title and also if there are pages available after this page.
  • Constructor Details

    • InventoryState

      public InventoryState()
      Construct a new InventoryState. This will intialize with a null inventory and title and with no next page or contents.
  • Method Details

    • getElementInSlot

      public GUIElement getElementInSlot(int slot)
      Retrieve the element currently positioned in a slot
      Parameters:
      slot - The slot to get the element currently in
      Returns:
      The current element in this slot, or null if none
    • getComputedContentsBySlot

      public Map<Integer,GUIElement> getComputedContentsBySlot()
      Get the currently computed contents of this InventoryState by slot
      Returns:
      A copy of the currently computed contents of this InventoryState by slot
    • setComputedContentsBySlot

      public void setComputedContentsBySlot(Map<Integer,GUIElement> computedContentsBySlot)
    • getTitle

      public String getTitle()
      Return the title calculated to be used to display this page, or null if none yet exists
      Returns:
      The title
    • setTitle

      public void setTitle(String title)
      Set the title calculated to be used to display this page, or null if none yet exists
      Parameters:
      title - The title
    • hasNextPage

      public boolean hasNextPage()
      Whether or not another page exists after this one
      Returns:
      True if another page exists after this one, or False if not
    • setHasNextPage

      public void setHasNextPage(boolean hasNextPage)
      Set whether or not another page exists after this one
      Parameters:
      hasNextPage - True if another page exists after this one, or False if not