Skip to content

Commit ad818ec

Browse files
0 index.
1 parent 5198fe5 commit ad818ec

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/me/flame/menus/menu/layout/MenuLayoutBuilderImpl.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
import java.util.*;
1111

12+
// changed
13+
1214
public class MenuLayoutBuilderImpl implements MenuLayoutBuilder {
1315
public final Map<Character, MenuItem> itemMap;
1416
private final List<MenuItem> items = new ArrayList<>(54);
@@ -22,8 +24,8 @@ public MenuLayoutBuilderImpl(Map<Character, MenuItem> itemMap) {
2224
@Override
2325
public MenuLayoutBuilder row(String string) {
2426
int stringsLength = string.length();
25-
if (items.size() == 54) {
26-
throw new IllegalArgumentException("Attempted to add more than 54 items (max inventory size)");
27+
if (items.size() == 53) {
28+
throw new IllegalArgumentException("Attempted to add more than 54 (53 if considering 0 index) items (max inventory size)");
2729
}
2830
if (stringsLength > MAX_ROW_SIZE) {
2931
throw new IllegalArgumentException("Too many strings (Temporary.. maybe?), length = "
@@ -34,7 +36,7 @@ public MenuLayoutBuilder row(String string) {
3436
char[] chars = string.toCharArray();
3537
int index = 0;
3638
for (; index != stringsLength; index++) {
37-
if (items.size() == 54) {
39+
if (items.size() == 53) {
3840
throw new IllegalArgumentException("Attempted to add more than 54 items (max inventory size)");
3941
}
4042
char character = chars[index];

0 commit comments

Comments
 (0)