public final class PaginatedGui extends BaseGui
| Constructor and Description |
|---|
PaginatedGui(@NotNull org.bukkit.plugin.Plugin plugin,
int rows,
int pageSize,
@NotNull String title) |
PaginatedGui(@NotNull org.bukkit.plugin.Plugin plugin,
@NotNull String title) |
| Modifier and Type | Method and Description |
|---|---|
BaseGui |
addItem(GuiItem... items)
Overridden method to add the items to the page instead
|
BaseGui |
addItem(@NotNull GuiItem item)
Adds an item to the next empty slot in the GUI
|
Map<Integer,GuiItem> |
getCurrentPageItems()
Gets the items on the current page
|
int |
getCurrentPageNum()
Gets the current page number
|
int |
getNextPageNum()
Gets the next page number
|
List<GuiItem> |
getPageItems()
Gets all the items added to the GUI
|
int |
getPrevPageNum()
Gets the previous page number
|
boolean |
nextPage()
Goes to the next page
|
void |
open(@NotNull org.bukkit.entity.HumanEntity player)
Opens the GUI in the first page
|
void |
open(@NotNull org.bukkit.entity.HumanEntity player,
int openPage)
Overridden open method to add the gui page items
|
boolean |
prevPage()
Goes to the previous page if possible
|
BaseGui |
setPageSize(int pageSize)
Sets the page size
|
void |
update()
Overridden update method to use the paginated open
|
void |
updatePageItem(int slot,
@NotNull GuiItem item)
Used for updating the current item in the page at runtime
|
void |
updatePageItem(int row,
int col,
@NotNull GuiItem item)
Used for updating the current item in the page at runtime
|
void |
updatePageItem(int row,
int col,
@NotNull org.bukkit.inventory.ItemStack itemStack)
Used for updating the current item in the page at runtime
|
void |
updatePageItem(int slot,
@NotNull org.bukkit.inventory.ItemStack itemStack)
Used for updating the current item in the page at runtime
|
addSlotAction, addSlotAction, close, getFiller, getGuiItem, getGuiItems, getInventory, getRows, isUpdating, setCloseGuiAction, setDefaultClickAction, setDefaultTopClickAction, setDragAction, setItem, setItem, setItem, setOpenGuiAction, setOutsideClickAction, setRows, setUpdating, updateItem, updateItem, updateItem, updateItem, updateTitlepublic PaginatedGui(@NotNull
@NotNull org.bukkit.plugin.Plugin plugin,
int rows,
int pageSize,
@NotNull
@NotNull String title)
public PaginatedGui(@NotNull
@NotNull org.bukkit.plugin.Plugin plugin,
@NotNull
@NotNull String title)
public BaseGui setPageSize(int pageSize)
pageSize - The new page sizepublic BaseGui addItem(@NotNull @NotNull GuiItem item)
item - The GUI itempublic BaseGui addItem(@NotNull GuiItem... items)
public void update()
public void updatePageItem(int slot,
@NotNull
@NotNull org.bukkit.inventory.ItemStack itemStack)
slot - The slot of the item to updateitemStack - The new ItemStackpublic void updatePageItem(int row,
int col,
@NotNull
@NotNull org.bukkit.inventory.ItemStack itemStack)
row - The row of the slotcol - The col of the slotitemStack - The new ItemStackpublic void updatePageItem(int slot,
@NotNull
@NotNull GuiItem item)
slot - The slot of the item to updateitem - The new ItemStackpublic void updatePageItem(int row,
int col,
@NotNull
@NotNull GuiItem item)
row - The row of the slotcol - The col of the slotitem - The new ItemStackpublic void open(@NotNull
@NotNull org.bukkit.entity.HumanEntity player)
public void open(@NotNull
@NotNull org.bukkit.entity.HumanEntity player,
int openPage)
player - The player to open it toopenPage - The specific page to open atpublic Map<Integer,GuiItem> getCurrentPageItems()
public List<GuiItem> getPageItems()
public int getCurrentPageNum()
public int getNextPageNum()
public int getPrevPageNum()
public boolean nextPage()
public boolean prevPage()
Copyright © 2020. All rights reserved.