Class GuiStateElement.State

java.lang.Object
de.themoep.inventorygui.GuiStateElement.State
Enclosing class:
GuiStateElement

public static class GuiStateElement.State
extends Object
A state that the GuiStateElement can have.
  • Constructor Details

    • State

      public State​(GuiStateElement.State.Change change, String key, org.bukkit.inventory.ItemStack item, String... text)
      A state that the GuiStateElement can have.
      Parameters:
      change - What to do when the state changes
      key - The state's string key
      item - The ItemStack to represent this state
      text - The text to display on this element, placeholders are automatically replaced, see InventoryGui.replaceVars(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

    • setText

      public void setText​(String... text)
      Set this element's display text. If this is an empty array the item's name will be displayed
      Parameters:
      text - The text to display on this element, placeholders are automatically replaced, see InventoryGui.replaceVars(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
    • getItem

      public org.bukkit.inventory.ItemStack getItem()
      Get the ItemStack that represents this state.
      Returns:
      The ItemStack that represents this state
    • getKey

      public String getKey()
      Get the string key of the state.
      Returns:
      The state's string key
    • getText

      public String[] getText()
      Get the text lines that describe this state.
      Returns:
      The text lines for this state