Skip to content

Commit 10feaa1

Browse files
Nullables and BM generic removed
1 parent 60de98d commit 10feaa1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/main/java/me/flame/menus/menu/iterator/MenuIterator.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public final class MenuIterator implements Iterator<MenuItem> {
2929

3030

3131
@NotNull
32-
private final BaseMenu<?> menu;
32+
private final BaseMenu menu;
3333

3434
private Slot next;
3535

@@ -38,23 +38,23 @@ public final class MenuIterator implements Iterator<MenuItem> {
3838
private final int rows;
3939

4040
private static final String NOTHING_MORE_NEXT =
41-
"Used PageIterator#next() but nothing more" +
41+
"Used MenuIterator#next() but nothing more" +
4242
"\nFix: Use hasNext() beforehand to avoid this error.";
4343

4444
private static final String NOTHING_MORE_NEXT_OPTIONAL =
45-
"Used PageIterator#nextOptional() but nothing more" +
45+
"Used MenuIterator#nextOptional() but nothing more" +
4646
"\nFix: Use hasNext() beforehand to avoid this error.";
4747

4848
private static final String NOTHING_MORE_NEXT_NOT_NULL =
49-
"Used PageIterator#nextNotNull() but nothing more";
49+
"Used MenuIterator#nextNotNull() but nothing more";
5050

5151
private static final String GREATER_THAN_ONE_ONLY =
52-
"Starting row and column must be 1 or greater, col 9 and under or rows 6 and under only." +
52+
"Starting row and column must be 1 or greater only." +
5353
"\nFix: If you're using an algorithm for rows/cols, you might wanna check it";
5454

5555
public MenuIterator(int startingRow, int startingCol,
5656
@NotNull IterationDirection direction,
57-
@NotNull BaseMenu<?> menu) {
57+
@NotNull BaseMenu menu) {
5858
Slot prepos = new Slot(startingRow, startingCol);
5959
if (!prepos.isSlot()) throw new IllegalArgumentException(GREATER_THAN_ONE_ONLY);
6060
this.menu = menu;
@@ -63,8 +63,8 @@ public MenuIterator(int startingRow, int startingCol,
6363

6464
this.rows = menu.getRows();
6565
}
66-
public MenuIterator(@NotNull IterationDirection direction,
67-
@NotNull BaseMenu<?> menu) {
66+
67+
public MenuIterator(@NotNull IterationDirection direction, @NotNull BaseMenu menu) {
6868
this.menu = menu;
6969
this.position = Slot.FIRST.copy();
7070
this.direction = direction;
@@ -78,7 +78,7 @@ public MenuIterator(@NotNull IterationDirection direction,
7878
* @param emptyOnly a boolean indicating whether to retrieve only empty slots
7979
* @return the next empty slot in the menu, or null if no empty slot is found
8080
*/
81-
public Slot nextSlot(boolean emptyOnly) {
81+
public @Nullable Slot nextSlot(boolean emptyOnly) {
8282
if (!emptyOnly) return nextSlot();
8383

8484
while (true) {

0 commit comments

Comments
 (0)