Skip to content

Commit 6037a4b

Browse files
Add public constructors
1 parent a916b70 commit 6037a4b

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/main/java/me/flame/menus/menu/PaginatedMenu.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,29 @@ public class PaginatedMenu extends BaseMenu<PaginatedMenu> {
4949
private int pageSize;
5050
private int pageNum = 1;
5151

52-
PaginatedMenu(final int rows, final int pageSize, @NotNull final String title, @NotNull final EnumSet<Modifier> modifiers, boolean colorize) {
53-
super(rows, title, modifiers, colorize);
54-
this.pageSize = pageSize;
55-
int inventorySize = rows * 9;
56-
this.currentPage = new LinkedHashMap<>(inventorySize);
52+
public PaginatedMenu(final int rows, final int pageSize, @NotNull final String title) {
53+
this(rows, pageSize, title, EnumSet.noneOf(Modifier.class));
5754
}
5855

59-
PaginatedMenu(final int rows, final int pageSize, @NotNull final String title, @NotNull final EnumSet<Modifier> modifiers) {
56+
public PaginatedMenu(final int rows, final int pageSize, @NotNull final String title, @NotNull final EnumSet<Modifier> modifiers) {
6057
super(rows, title, modifiers, true);
58+
this.pageItems = new LinkedHashMap<>(rows * 9);
59+
this.pages = new Page[pages];
6160
this.pageSize = pageSize;
62-
int inventorySize = rows * 9;
63-
this.currentPage = new LinkedHashMap<>(inventorySize);
6461
}
6562

66-
PaginatedMenu(final MenuType type, final int pageSize, @NotNull final String title, @NotNull final EnumSet<Modifier> modifiers, boolean colorize) {
63+
public PaginatedMenu(final MenuType type, final int pageSize, @NotNull final String title, @NotNull final EnumSet<Modifier> modifiers, boolean colorize) {
6764
super(type, title, modifiers, colorize);
65+
this.pageItems = new LinkedHashMap<>(rows * 9);
66+
this.pages = new Page[pages];
6867
this.pageSize = pageSize;
69-
this.currentPage = new LinkedHashMap<>(9);
7068
}
7169

72-
PaginatedMenu(final MenuType type, final int pageSize, @NotNull final String title, @NotNull final EnumSet<Modifier> modifiers) {
70+
public PaginatedMenu(final MenuType type, final int pageSize, @NotNull final String title, @NotNull final EnumSet<Modifier> modifiers) {
7371
super(type, title, modifiers, true);
72+
this.pageItems = new LinkedHashMap<>(rows * 9);
73+
this.pages = new Page[pages];
7474
this.pageSize = pageSize;
75-
this.currentPage = new LinkedHashMap<>(9);
7675
}
7776

7877
/**

0 commit comments

Comments
 (0)