Skip to content

Commit 93da41a

Browse files
Fix?
1 parent 9c03e79 commit 93da41a

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

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

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

52-
public PaginatedMenu(final int rows, final int pageSize, @NotNull final String title) {
53-
this(rows, pageSize, title, EnumSet.noneOf(Modifier.class));
52+
public 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);
5457
}
5558

5659
public PaginatedMenu(final int rows, final int pageSize, @NotNull final String title, @NotNull final EnumSet<Modifier> modifiers) {
5760
super(rows, title, modifiers, true);
58-
this.pageItems = new LinkedHashMap<>(rows * 9);
5961
this.pageSize = pageSize;
62+
int inventorySize = rows * 9;
63+
this.currentPage = new LinkedHashMap<>(inventorySize);
6064
}
6165

66+
public PaginatedMenu(final int rows, final int pageSize, @NotNull final String title) {
67+
super(rows, title, EnumSet.noneOf(Modifier.class), true);
68+
this.pageSize = pageSize;
69+
int inventorySize = rows * 9;
70+
this.currentPage = new LinkedHashMap<>(inventorySize);
71+
}
72+
73+
6274
public PaginatedMenu(final MenuType type, final int pageSize, @NotNull final String title, @NotNull final EnumSet<Modifier> modifiers, boolean colorize) {
6375
super(type, title, modifiers, colorize);
64-
this.pageItems = new LinkedHashMap<>(rows * 9);
6576
this.pageSize = pageSize;
77+
this.currentPage = new LinkedHashMap<>(9);
6678
}
6779

6880
public PaginatedMenu(final MenuType type, final int pageSize, @NotNull final String title, @NotNull final EnumSet<Modifier> modifiers) {
6981
super(type, title, modifiers, true);
70-
this.pageItems = new LinkedHashMap<>(rows * 9);
7182
this.pageSize = pageSize;
83+
this.currentPage = new LinkedHashMap<>(9);
7284
}
7385

7486
/**

0 commit comments

Comments
 (0)