Class MaskPaginatedMask
java.lang.Object
io.github.projectunified.craftux.mask.PaginatedMask
io.github.projectunified.craftux.mask.MaskPaginatedMask
An abstract mask that displays one mask at a time from a list, allowing pagination through multiple masks.
Each page shows the actions from a single mask in the list.
Example usage:
public class MyMaskPaginatedMask extends MaskPaginatedMask {
@Override
public List<Mask> getMasks(UUID uuid) {
return Arrays.asList(
new SingleMask(Position.of(0, 0), new SimpleButton(new ItemStack(Material.APPLE))),
new SingleMask(Position.of(0, 0), new SimpleButton(new ItemStack(Material.BREAD))),
new SingleMask(Position.of(0, 0), new SimpleButton(new ItemStack(Material.COOKED_BEEF)))
);
}
}
-
Field Summary
Fields inherited from class io.github.projectunified.craftux.mask.PaginatedMask
cycle, pageNumberMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable Map<Position, Consumer<ActionItem>> getItemMap(@NotNull UUID uuid, int pageNumber) Generate the item map for the unique idGet the masks for the unique idvoidstop()Clears the page number mappings for all users.Methods inherited from class io.github.projectunified.craftux.mask.PaginatedMask
apply, getAndSetExactPage, getExactPage, getPage, isCycle, nextPage, previousPage, setCycle, setPageMethods 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
-
Constructor Details
-
MaskPaginatedMask
public MaskPaginatedMask()
-
-
Method Details
-
getMasks
Get the masks for the unique id- Parameters:
uuid- the unique id- Returns:
- the masks
-
getItemMap
@Nullable protected @Nullable Map<Position,Consumer<ActionItem>> getItemMap(@NotNull @NotNull UUID uuid, int pageNumber) Description copied from class:PaginatedMaskGenerate the item map for the unique id- Specified by:
getItemMapin classPaginatedMask- Parameters:
uuid- the unique idpageNumber- the page number- Returns:
- the map contains the positions and the buttons
-
stop
public void stop()Clears the page number mappings for all users.
-