public class PaginatedGui extends BaseGui
| Constructor and Description |
|---|
PaginatedGui(int rows,
int pageSize,
@NotNull String title)
Main constructor of the PaginatedGui
|
PaginatedGui(int rows,
@NotNull String title)
Alternative constructor that doesn't require the
pageSize to be defined |
PaginatedGui(@NotNull org.bukkit.plugin.Plugin plugin,
int rows,
int pageSize,
@NotNull String title)
Deprecated.
No longer requires the plugin's instance to be passed use
PaginatedGui(int, int, String) instead |
PaginatedGui(@NotNull org.bukkit.plugin.Plugin plugin,
int rows,
@NotNull String title)
Deprecated.
No longer requires the plugin's instance to be passed use
PaginatedGui(int, String) instead |
PaginatedGui(@NotNull org.bukkit.plugin.Plugin plugin,
@NotNull String title)
Deprecated.
No longer requires the plugin's instance to be passed use
PaginatedGui(String) instead |
PaginatedGui(@NotNull String title)
Alternative constructor that only requires title
|
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(GuiItem... items)
Overridden
BaseGui.addItem(GuiItem...) to add the items to the page instead |
void |
addItem(@NotNull GuiItem item)
Adds an
GuiItem to the next available slot in the page area |
Map<Integer,GuiItem> |
getCurrentPageItems()
Gets an immutable
Map with all the current pages items |
int |
getCurrentPageNum()
Gets the current page number
|
int |
getNextPageNum()
Gets the next page number
|
List<GuiItem> |
getPageItems()
Gets an immutable
List with all the page items added to the GUI |
int |
getPrevPageNum()
Gets the previous page number
|
boolean |
next()
Goes to the next page
|
boolean |
nextPage()
Deprecated.
Use
next() instead |
void |
open(@NotNull org.bukkit.entity.HumanEntity player)
Overrides
BaseGui.open(HumanEntity) to use the paginated populator instead |
void |
open(@NotNull org.bukkit.entity.HumanEntity player,
int openPage)
Specific open method for the Paginated GUI
Uses
populatePage() |
boolean |
previous()
Goes to the previous page if possible
|
boolean |
prevPage()
Deprecated.
Use
previous() instead |
BaseGui |
setPageSize(int pageSize)
Sets the page size
|
void |
update()
Overridden
BaseGui.update() to use the paginated open |
void |
updatePageItem(int slot,
@NotNull GuiItem item)
Alternative
updatePageItem(int, ItemStack) that uses GuiItem instead |
void |
updatePageItem(int row,
int col,
@NotNull GuiItem item)
Alternative
updatePageItem(int, GuiItem) that uses ROWS and COLUMNS instead |
void |
updatePageItem(int row,
int col,
@NotNull org.bukkit.inventory.ItemStack itemStack)
Alternative
updatePageItem(int, ItemStack) that uses ROWS and COLUMNS instead |
void |
updatePageItem(int slot,
@NotNull org.bukkit.inventory.ItemStack itemStack)
Updates the page
GuiItem on the slot in the page
Can get the slot from InventoryClickEvent.getSlot() |
BaseGui |
updateTitle(@NotNull String title)
Overrides
BaseGui.updateTitle(String) to use the paginated populator instead
Updates the title of the GUI
This method may cause LAG if used on a loop |
addSlotAction, addSlotAction, close, getFiller, getGuiItem, getGuiItems, getInventory, getRows, isUpdating, removeItem, removeItem, setCloseGuiAction, setDefaultClickAction, setDefaultTopClickAction, setDragAction, setItem, setItem, setItem, setOpenGuiAction, setOutsideClickAction, setRows, setUpdating, updateItem, updateItem, updateItem, updateItempublic PaginatedGui(int rows,
int pageSize,
@NotNull
@NotNull String title)
rows - The rows the GUI should havepageSize - The pageSizetitle - The GUI's titlepublic PaginatedGui(int rows,
@NotNull
@NotNull String title)
pageSize to be definedrows - The rows the GUI should havetitle - The GUI's titlepublic PaginatedGui(@NotNull
@NotNull String title)
title - The GUI's title@Deprecated public PaginatedGui(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, int rows, int pageSize, @NotNull @NotNull String title)
PaginatedGui(int, int, String) insteadplugin - The plugin's instancerows - The rows the GUI should havepageSize - The pageSizetitle - The GUI's title@Deprecated public PaginatedGui(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, int rows, @NotNull @NotNull String title)
PaginatedGui(int, String) insteadplugin - The plugin's instancerows - The rows the GUI should havetitle - The GUI's title@Deprecated public PaginatedGui(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull String title)
PaginatedGui(String) insteadplugin - The plugin's instancetitle - The GUI's titlepublic BaseGui setPageSize(int pageSize)
pageSize - The new page sizepublic void addItem(@NotNull
@NotNull GuiItem item)
GuiItem to the next available slot in the page areaitem - The GuiItem to add to the pagepublic void addItem(@NotNull
GuiItem... items)
BaseGui.addItem(GuiItem...) to add the items to the page insteadpublic void update()
BaseGui.update() to use the paginated openpublic void updatePageItem(int slot,
@NotNull
@NotNull org.bukkit.inventory.ItemStack itemStack)
GuiItem on the slot in the page
Can get the slot from InventoryClickEvent.getSlot()slot - The slot of the item to updateitemStack - The new ItemStackpublic void updatePageItem(int row,
int col,
@NotNull
@NotNull org.bukkit.inventory.ItemStack itemStack)
updatePageItem(int, ItemStack) that uses ROWS and COLUMNS insteadrow - The row of the slotcol - The columns of the slotitemStack - The new ItemStackpublic void updatePageItem(int slot,
@NotNull
@NotNull GuiItem item)
updatePageItem(int, ItemStack) that uses GuiItem insteadslot - The slot of the item to updateitem - The new ItemStackpublic void updatePageItem(int row,
int col,
@NotNull
@NotNull GuiItem item)
updatePageItem(int, GuiItem) that uses ROWS and COLUMNS insteadrow - The row of the slotcol - The columns of the slotitem - The new GuiItempublic void open(@NotNull
@NotNull org.bukkit.entity.HumanEntity player)
BaseGui.open(HumanEntity) to use the paginated populator insteadpublic void open(@NotNull
@NotNull org.bukkit.entity.HumanEntity player,
int openPage)
populatePage()player - The HumanEntity to open it toopenPage - The specific page to open atpublic BaseGui updateTitle(@NotNull @NotNull String title)
BaseGui.updateTitle(String) to use the paginated populator instead
Updates the title of the GUI
This method may cause LAG if used on a loopupdateTitle in class BaseGuititle - The title to setpublic Map<Integer,GuiItem> getCurrentPageItems()
Map with all the current pages itemsMap with all the currentPagepublic List<GuiItem> getPageItems()
List with all the page items added to the GUIpublic int getCurrentPageNum()
public int getNextPageNum()
pageNum if no next is presentpublic int getPrevPageNum()
pageNum if no previous is presentpublic boolean next()
@Deprecated public boolean nextPage()
next() insteadpublic boolean previous()
@Deprecated public boolean prevPage()
previous() insteadCopyright © 2020. All rights reserved.