You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
no errors or anything, but the last slot would always be ignored because it's rows * 9 - 1 but it should be rows * 9.
Also remove the unnecessary math: (excluding the - 1)
(rows * 9) + 9 - 9
to
rows * 9
thrownewIllegalStateException("No patterns specified. Use the pattern() method before creating the menu.");
74
+
thrownewIllegalStateException("No patterns specified. \nFix: use the pattern() method before creating the menu.");
75
+
elseif (rows > 6 || rows < 1)
76
+
thrownewIllegalStateException("Patterns array has too many rows (" + rows + "). \nFix: Reduce/increase the amount of strings in the array of pattern()");
75
77
Menumenu = Menu.create(title, rows);
76
78
77
-
intsize = ((rows * 9) + 9) - 10;
79
+
intsize = rows * 9;
78
80
for (inti = 0; i < size; i++) {
79
81
introw = i / 9;
80
82
intcol = i % 9;
@@ -95,10 +97,12 @@ public Menu createMenu(String title) {
thrownewIllegalStateException("No patterns specified. Use the pattern() method before creating the menu.");
100
+
thrownewIllegalStateException("No patterns specified. \nFix: use the pattern() method before creating the menu.");
101
+
elseif (rows > 6 || rows < 1)
102
+
thrownewIllegalStateException("Patterns array has too many rows (" + rows + "). \nFix: Reduce/increase the amount of strings in the array of pattern()");
99
103
Menumenu = Menu.create(title, rows, modifiers);
100
104
101
-
intsize = ((rows * 9) + 9) - 10;
105
+
intsize = rows * 9;
102
106
for (inti = 0; i < size; i++) {
103
107
introw = i / 9;
104
108
intcol = i % 9;
@@ -121,10 +125,12 @@ public Menu createMenu(String title, EnumSet<Modifier> modifiers) {
thrownewIllegalStateException("No patterns specified. Use the pattern() method before creating the menu.");
128
+
thrownewIllegalStateException("No patterns specified. \nFix: use the pattern() method before creating the menu.");
129
+
elseif (rows > 6 || rows < 1)
130
+
thrownewIllegalStateException("Patterns array has too many rows (" + rows + "). \nFix: Reduce/increase the amount of strings in the array of pattern()");
thrownewIllegalStateException("No patterns specified. Use the pattern() method before creating the menu.");
156
+
thrownewIllegalStateException("No patterns specified. \nFix: use the pattern() method before creating the menu.");
157
+
elseif (rows > 6 || rows < 1)
158
+
thrownewIllegalStateException("Patterns array has too many rows (" + rows + "). \nFix: Reduce/increase the amount of strings in the array of pattern()");
@@ -166,16 +174,17 @@ public PaginatedMenu createPaginated(String title, int pages, EnumSet<Modifier>
166
174
167
175
/**
168
176
* Creates a paginated menu with the given title and populates it with items.
169
-
*
170
177
* @param title the title of the paginated menu
171
178
* @return the created paginated menu
172
179
*/
173
180
publicPaginatedMenucreatePaginated(Stringtitle) {
174
181
if (patterns == null)
175
-
thrownewIllegalStateException("No patterns specified. Use the pattern() method before creating the menu.");
182
+
thrownewIllegalStateException("No patterns specified. \nFix: use the pattern() method before creating the menu.");
183
+
elseif (rows > 6 || rows < 1)
184
+
thrownewIllegalStateException("Patterns array has too many rows (" + rows + "). \nFix: Reduce/increase the amount of strings in the array of pattern()");
0 commit comments