Class PagedInventoryBuilder
- java.lang.Object
-
- com.mrivanplays.pagedinventory.api.PagedInventoryBuilder
-
public class PagedInventoryBuilder extends Object
Represents a builder ofPagedInventory
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull PagedInventorybuild()Builds into aPagedInventory@NotNull PagedInventoryBuilderclickFunction(@NotNull Consumer<PageClick> clickListener)Adds a click function to listen for click events on the inventories.@NotNull PagedInventoryBuildercloseFunction(@NotNull Consumer<PageClose> closeListener)Adds a close function to listen for close events on the inventories.static @NotNull PagedInventoryBuildercreateBuilder(@NotNull org.bukkit.plugin.Plugin plugin)Creates a new builder instance@NotNull PagedInventoryBuildernavigationItem(int slot, @NotNull NavigationItem navigationItem)Sets the specified inventory slot to the specifiedNavigationItem@NotNull PagedInventoryBuilderpage(int pageNum, @NotNull Page page)Sets the page number to the specified page@NotNull PagedInventoryBuilderpage(int page, @NotNull org.bukkit.inventory.Inventory inventory)Sets the page number to the specified page
-
-
-
Method Detail
-
createBuilder
@NotNull public static @NotNull PagedInventoryBuilder createBuilder(@NotNull @NotNull org.bukkit.plugin.Plugin plugin)
Creates a new builder instance- Parameters:
plugin- plugin owner- Returns:
- builder
-
page
@NotNull public @NotNull PagedInventoryBuilder page(int page, @NotNull @NotNull org.bukkit.inventory.Inventory inventory)
Sets the page number to the specified page- Parameters:
page- page numberinventory- page- Returns:
- this instance for chaining
-
page
@NotNull public @NotNull PagedInventoryBuilder page(int pageNum, @NotNull @NotNull Page page)
Sets the page number to the specified page- Parameters:
pageNum- page numberpage- page- Returns:
- this instance for chaining
-
navigationItem
@NotNull public @NotNull PagedInventoryBuilder navigationItem(int slot, @NotNull @NotNull NavigationItem navigationItem)
Sets the specified inventory slot to the specifiedNavigationItem- Parameters:
slot- slotnavigationItem- navigation item- Returns:
- this instance for chaining
-
clickFunction
@NotNull public @NotNull PagedInventoryBuilder clickFunction(@NotNull @NotNull Consumer<PageClick> clickListener)
Adds a click function to listen for click events on the inventories.- Parameters:
clickListener- click listener- Returns:
- this instance for chaining
-
closeFunction
@NotNull public @NotNull PagedInventoryBuilder closeFunction(@NotNull @NotNull Consumer<PageClose> closeListener)
Adds a close function to listen for close events on the inventories.- Parameters:
closeListener- close listener- Returns:
- this instance for chaining
-
build
@NotNull public @NotNull PagedInventory build()
Builds into aPagedInventory- Returns:
- paged inventory
-
-