Package de.themoep.inventorygui
Class GuiPageElement
java.lang.Object
de.themoep.inventorygui.GuiElement
de.themoep.inventorygui.StaticGuiElement
de.themoep.inventorygui.GuiPageElement
This is an element that allows for controlling the pagination of the gui.
Untested und potentially unfinished.
-
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
ConstructorDescriptionGuiPageElement
(char slotChar, org.bukkit.inventory.ItemStack item, GuiPageElement.PageAction pageAction, String... text) An element that allows for controlling the pagination of the gui. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStack
getItem
(org.bukkit.entity.HumanEntity who, int slot) Get the item that is displayed by this element on a certain pageboolean
isSilent()
Get whether or not this element should make a sound when interacted withvoid
setSilent
(boolean silent) Set whether or not this element should make a sound when interacted withMethods 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
-
GuiPageElement
public GuiPageElement(char slotChar, org.bukkit.inventory.ItemStack item, GuiPageElement.PageAction pageAction, String... text) An element that allows for controlling the pagination of the gui.- Parameters:
slotChar
- The character to replace in the gui setup stringitem
- TheItemStack
representing this elementpageAction
- What kind of page action you want to happen when interacting with the element.text
- The text to display on this element, placeholders are automatically replaced, seeInventoryGui.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
-
isSilent
public boolean isSilent()Get whether or not this element should make a sound when interacted with- Returns:
- Whether or not to make a sound when interacted with
-
setSilent
public void setSilent(boolean silent) Set whether or not this element should make a sound when interacted with- Parameters:
silent
- Whether or not to make a sound when interacted with
-
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
-