Class PaginatedMask
java.lang.Object
io.github.projectunified.craftux.mask.PaginatedMask
- Direct Known Subclasses:
ButtonPaginatedMask,MaskPaginatedMask,SequencePaginatedMask
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Map<Position, Consumer<ActionItem>> Get a map of positions to action item consumersprotected intgetAndSetExactPage(UUID uuid, int page, int pageAmount) Get the exact page from the input page and set it if it's not the sameprotected intgetExactPage(int page, int pageAmount) Get the exact page from the input pageprotected abstract @Nullable Map<Position, Consumer<ActionItem>> getItemMap(@NotNull UUID uuid, int pageNumber) Generate the item map for the unique idintGet the current page for the unique idbooleanisCycle()Check if this paginated mask allows cycle page (The first page after the last page)voidSet the next page for the unique idvoidpreviousPage(@NotNull UUID uuid) Set the previous page for the unique idvoidsetCycle(boolean cycle) Set if this paginated mask allows cycle page (The first page after the last page)voidSet the page for the unique idMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.projectunified.craftux.common.Mask
getActionMap
-
Field Details
-
pageNumberMap
-
cycle
protected boolean cycle
-
-
Constructor Details
-
PaginatedMask
public PaginatedMask()
-
-
Method Details
-
getItemMap
@Nullable protected abstract @Nullable Map<Position,Consumer<ActionItem>> getItemMap(@NotNull @NotNull UUID uuid, int pageNumber) Generate the item map for the unique id- Parameters:
uuid- the unique idpageNumber- the page number- Returns:
- the map contains the positions and the buttons
-
getExactPage
protected int getExactPage(int page, int pageAmount) Get the exact page from the input page- Parameters:
page- the input pagepageAmount- the amount of pages- Returns:
- the exact page
-
getAndSetExactPage
Get the exact page from the input page and set it if it's not the same- Parameters:
uuid- the unique idpage- the input pagepageAmount- the amount of pages- Returns:
- the exact page
-
setPage
Set the page for the unique id- Parameters:
uuid- the unique idpage- the page
-
getPage
Get the current page for the unique id- Parameters:
uuid- the unique id- Returns:
- the page number
-
nextPage
Set the next page for the unique id- Parameters:
uuid- the unique id
-
previousPage
Set the previous page for the unique id- Parameters:
uuid- the unique id
-
isCycle
public boolean isCycle()Check if this paginated mask allows cycle page (The first page after the last page)- Returns:
- true if it does
-
setCycle
public void setCycle(boolean cycle) Set if this paginated mask allows cycle page (The first page after the last page)- Parameters:
cycle- true if it does
-
apply
Description copied from interface:MaskGet a map of positions to action item consumers
-