mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
Make registries Keyed.
This commit is contained in:
@ -34,6 +34,7 @@ public abstract class PaginationBox extends MessageBox {
|
||||
|
||||
private String pageCommand;
|
||||
private int componentsPerPage = IDEAL_ROWS_FOR_PLAYER;
|
||||
private int currentPage = -1;
|
||||
|
||||
/**
|
||||
* Creates a Paginated component
|
||||
@ -57,6 +58,10 @@ public abstract class PaginationBox extends MessageBox {
|
||||
this.componentsPerPage = 20;
|
||||
}
|
||||
|
||||
protected final int getCurrentPage() {
|
||||
return currentPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Paginated component
|
||||
*
|
||||
@ -80,6 +85,7 @@ public abstract class PaginationBox extends MessageBox {
|
||||
if (page < 1 || page > pageCount) {
|
||||
throw new InvalidComponentException("Invalid page number.");
|
||||
}
|
||||
currentPage = page;
|
||||
final int lastComp = Math.min(page * componentsPerPage, getComponentsSize());
|
||||
for (int i = (page - 1) * componentsPerPage; i < lastComp; i++) {
|
||||
getContents().append(getComponent(i));
|
||||
|
Reference in New Issue
Block a user