Package me.efekos.simpler.menu
Class PaginatedMenu
java.lang.Object
me.efekos.simpler.menu.Menu
me.efekos.simpler.menu.PaginatedMenu
- All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder
A custom menu implementation tha lets you make a paginated menu by just providing some items, everything else is
handled by this class.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
Maximum slots that are avaliable to put items in one page. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns a boolean that indicates click cancels for this menu.void
fill()
Main method to set menu items.int
getRows()
Returns a row amount for this menu.void
onClick
(org.bukkit.event.inventory.InventoryClickEvent e) Executes when someone clicks to an item in this menu.protected abstract List<org.bukkit.inventory.ItemStack>
setItems()
A method that should provide the content of this menu.Methods inherited from class me.efekos.simpler.menu.Menu
back, createItem, createSkull, fillEmptyWith, getInventory, getSlots, getTitle, onClose, onOpen, open, refresh
-
Field Details
-
maxItemsPerPage
protected static final int maxItemsPerPageMaximum slots that are avaliable to put items in one page.- See Also:
-
-
Constructor Details
-
Method Details
-
setItems
A method that should provide the content of this menu.- Returns:
- A list of items to display.
-
cancelAllClicks
public boolean cancelAllClicks()Returns a boolean that indicates click cancels for this menu.- Specified by:
cancelAllClicks
in classMenu
- Returns:
- Should all the clicks at this menu get cancelled?
-
getRows
public int getRows()Returns a row amount for this menu.- Specified by:
getRows
in classMenu
- Returns:
- How many rows this menu will have. Your menu will have
Menu.getRows()
*9 slots, since every row makes 9 slot.
-
onClick
public void onClick(org.bukkit.event.inventory.InventoryClickEvent e) Executes when someone clicks to an item in this menu. -
fill
public void fill()Main method to set menu items. Add the buttons, items and glass panes to your menu inside this method.
-