Class GuiBackElement


public class GuiBackElement extends StaticGuiElement
An element that will not appear if there is no previous history, but will go back one step if there is
  • Constructor Details

    • GuiBackElement

      public GuiBackElement(char slotChar, org.bukkit.inventory.ItemStack item, String... text)
      An element used to go back in history of the gui if there is something to go back to. Will not display when there is nothing to go back to.
      Parameters:
      slotChar - The character to replace in the gui setup string
      item - The ItemStack representing this element
      text - The text to display on this element, placeholders are automatically replaced, see InventoryGui.replaceVars(org.bukkit.entity.HumanEntity, java.lang.String, java.lang.String...) for a list of the placeholder variables. Empty text strings are also filter out, use a single space if you want to add an empty line!
      If it's not set/empty the item's default name will be used
    • GuiBackElement

      public GuiBackElement(char slotChar, org.bukkit.inventory.ItemStack item, boolean close, String... text)
      An element used to go back in history of the gui
      Parameters:
      slotChar - The character to replace in the gui setup string
      item - The ItemStack representing this element
      close - Whether to close the GUI if there is nothing to go back to. Will not display item if set to false and nothing to go back to.
      text - The text to display on this element, placeholders are automatically replaced, see InventoryGui.replaceVars(org.bukkit.entity.HumanEntity, java.lang.String, java.lang.String...) for a list of the placeholder variables. Empty text strings are also filter out, use a single space if you want to add an empty line!
      If it's not set/empty the item's default name will be used
  • Method Details

    • getItem

      public org.bukkit.inventory.ItemStack getItem(org.bukkit.entity.HumanEntity who, int slot)
      Description copied from class: GuiElement
      Get the item that is displayed by this element on a certain page
      Overrides:
      getItem in class StaticGuiElement
      Parameters:
      who - The player who views the page
      slot - The slot to get the item for
      Returns:
      The ItemStack that is displayed as this element
    • canClose

      public boolean canClose()
      Whether this element can close the GUI when nothing to go back to
      Returns:
      Close the GUI when nothing to go back