Package de.themoep.inventorygui
Class GuiBackElement
java.lang.Object
de.themoep.inventorygui.GuiElement
de.themoep.inventorygui.StaticGuiElement
de.themoep.inventorygui.GuiBackElement
An element that will not appear if there is no previous history,
but will go back one step if there is
-
Nested Class Summary
Nested classes/interfaces inherited from class de.themoep.inventorygui.GuiElement
GuiElement.Action, GuiElement.Click
-
Field Summary
Fields inherited from class de.themoep.inventorygui.GuiElement
gui, slots
-
Constructor Summary
ConstructorsConstructorDescriptionGuiBackElement
(char slotChar, org.bukkit.inventory.ItemStack item, boolean close, String... text) An element used to go back in history of the guiGuiBackElement
(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. -
Method Summary
Methods inherited from class de.themoep.inventorygui.StaticGuiElement
getNumber, getRawItem, getText, setItem, setNumber, setText
Methods inherited from class de.themoep.inventorygui.GuiElement
getAction, getGui, getSlotChar, getSlotIndex, getSlotIndex, getSlots, setAction, setGui, setSlots
-
Constructor Details
-
GuiBackElement
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 stringitem
- TheItemStack
representing this elementtext
- The text to display on this element, placeholders are automatically replaced, seeInventoryGui.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
-
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 stringitem
- TheItemStack
representing this elementclose
- 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, seeInventoryGui.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
-
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 classStaticGuiElement
- Parameters:
who
- The player who views the pageslot
- 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
-