Class PagedMenu
java.lang.Object
dev.demeng.pluginbase.menu.layout.PagedMenu
- All Implemented Interfaces:
IMenu
A paginated GUI menu that will be displayed to a player.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSettings for the paged menu. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPagedMenu(int pageSize, @NotNull String title, PagedMenu.Settings settings) Creates a new paged menu with the specified size per page and inventory title. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddButton(int slot, @NotNull org.bukkit.inventory.ItemStack stack, @Nullable Consumer<org.bukkit.event.inventory.InventoryClickEvent> actions) Creates and adds a static item that will be displayed on all pages.protected voidaddStaticButton(MenuButton button) Adds a static item that will be displayed on all pages.voidfill(List<MenuButton> buttons) Fills the pages with the list of buttons.getPages()voidopen(int index, org.bukkit.entity.Player... players) Opens a specific page of the menu to the players.voidopen(org.bukkit.entity.Player... players) Opens the menu for the provided player(s).
-
Constructor Details
-
Method Details
-
getPages
-
fill
Fills the pages with the list of buttons.- Parameters:
buttons- The buttons that the menu should be filled with
-
addButton
public void addButton(int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack stack, @Nullable @Nullable Consumer<org.bukkit.event.inventory.InventoryClickEvent> actions) Creates and adds a static item that will be displayed on all pages. Must be done AFTER thefill(List)method.- Parameters:
slot- The slot of the buttonstack- The stack of the buttonactions- The actions of the button
-
open
public void open(org.bukkit.entity.Player... players) Description copied from interface:IMenuOpens the menu for the provided player(s). -
open
public void open(int index, org.bukkit.entity.Player... players) Opens a specific page of the menu to the players.- Parameters:
index- The index of the page (starts at 0)players- THe players to open the page to
-