Package com.kamikazejam.kamicommon.menu
Class PaginatedMenu
java.lang.Object
com.kamikazejam.kamicommon.menu.api.MenuHolder
com.kamikazejam.kamicommon.menu.AbstractMenu<PaginatedMenu>
com.kamikazejam.kamicommon.menu.PaginatedMenu
- All Implemented Interfaces:
UpdatingMenu
,Menu<PaginatedMenu>
,InventoryHolder
This Menu class focuses on providing an easy way of creating a menu with multiple pages. This menu allows you to
provide all the items you want to display, and it will automatically paginate them for you.
Pagination configuration is available by creating your own
Pagination configuration is available by creating your own
PaginationLayout
or by modifying a pre-built one.-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.kamikazejam.kamicommon.menu.AbstractMenu
events, menuIcons, options, player
Fields inherited from class com.kamikazejam.kamicommon.menu.api.MenuHolder
inventory, size, title
-
Method Summary
Modifier and TypeMethodDescriptionint
@NotNull PaginatedMenuOptions
@NotNull PaginatedMenu
modifyPageIcons
(@NotNull Consumer<IPageIconsAccess<PaginatedMenu>> consumer) @Nullable InventoryView
open()
@Nullable InventoryView
open
(int p) protected void
Methods inherited from class com.kamikazejam.kamicommon.menu.AbstractMenu
close, getFillerIcon, getMenuIcons, getMenuIconsAccess, modifyIcons, open, placeIcons, reopenMenu, reopenMenu, resizeMenu, setSize, updateOneTick
Methods inherited from class com.kamikazejam.kamicommon.menu.api.MenuHolder
clear, closeAll, deleteInventory, equals, firstEmpty, firstEmpty, firstEmpty, getHolder, getInventory, getItem, getMenuSize, getRawInventory, getSize, getViewers, hashCode, replaceTitle, setItem, setItem
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.kamikazejam.kamicommon.menu.Menu
buildClickData, buildPlayerClickData, getEvents, getMenuSize
Methods inherited from interface com.kamikazejam.kamicommon.menu.api.icons.interfaces.UpdatingMenu
getInventory
-
Method Details
-
getOptions
-
open
Description copied from class:AbstractMenu
- Overrides:
open
in classAbstractMenu<PaginatedMenu>
- Returns:
- The
InventoryView
for the new menu, or null if the player was not online to open the menu for.
-
open
- Parameters:
p
- The page index to open (0-indexed)
-
placeFiller
protected void placeFiller(Map<Integer, @Nullable ItemStack> newMenuState, Set<Integer> slots, int tick) - Overrides:
placeFiller
in classAbstractMenu<PaginatedMenu>
-
getCurrentPage
public int getCurrentPage()- Returns:
- The current page (0-indexed)
-
modifyPageIcons
@NotNull public @NotNull PaginatedMenu modifyPageIcons(@NotNull @NotNull Consumer<IPageIconsAccess<PaginatedMenu>> consumer)
-