Class PaginatedMenu

java.lang.Object
me.efekos.simpler.menu.Menu
me.efekos.simpler.menu.PaginatedMenu
All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder

public abstract class PaginatedMenu extends Menu
A custom menu implementation tha lets you make a paginated menu by just providing some items, everything else is handled by this class.
  • Field Details

    • maxItemsPerPage

      protected static final int maxItemsPerPage
      Maximum slots that are avaliable to put items in one page.
      See Also:
  • Constructor Details

    • PaginatedMenu

      public PaginatedMenu(MenuData data)
      Creates a new instance of this menu.
      Parameters:
      data - Menu data.
  • Method Details

    • setItems

      protected abstract List<org.bukkit.inventory.ItemStack> 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 class Menu
      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 class Menu
      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.
      Specified by:
      onClick in class Menu
      Parameters:
      e - Instance of the event.
    • fill

      public void fill()
      Main method to set menu items. Add the buttons, items and glass panes to your menu inside this method.
      Specified by:
      fill in class Menu