@@ -29,7 +29,7 @@ public final class MenuIterator implements Iterator<MenuItem> {
29
29
30
30
31
31
@ NotNull
32
- private final BaseMenu <?> menu ;
32
+ private final BaseMenu menu ;
33
33
34
34
private Slot next ;
35
35
@@ -38,23 +38,23 @@ public final class MenuIterator implements Iterator<MenuItem> {
38
38
private final int rows ;
39
39
40
40
private static final String NOTHING_MORE_NEXT =
41
- "Used PageIterator #next() but nothing more" +
41
+ "Used MenuIterator #next() but nothing more" +
42
42
"\n Fix: Use hasNext() beforehand to avoid this error." ;
43
43
44
44
private static final String NOTHING_MORE_NEXT_OPTIONAL =
45
- "Used PageIterator #nextOptional() but nothing more" +
45
+ "Used MenuIterator #nextOptional() but nothing more" +
46
46
"\n Fix: Use hasNext() beforehand to avoid this error." ;
47
47
48
48
private static final String NOTHING_MORE_NEXT_NOT_NULL =
49
- "Used PageIterator #nextNotNull() but nothing more" ;
49
+ "Used MenuIterator #nextNotNull() but nothing more" ;
50
50
51
51
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." +
53
53
"\n Fix: If you're using an algorithm for rows/cols, you might wanna check it" ;
54
54
55
55
public MenuIterator (int startingRow , int startingCol ,
56
56
@ NotNull IterationDirection direction ,
57
- @ NotNull BaseMenu <?> menu ) {
57
+ @ NotNull BaseMenu menu ) {
58
58
Slot prepos = new Slot (startingRow , startingCol );
59
59
if (!prepos .isSlot ()) throw new IllegalArgumentException (GREATER_THAN_ONE_ONLY );
60
60
this .menu = menu ;
@@ -63,8 +63,8 @@ public MenuIterator(int startingRow, int startingCol,
63
63
64
64
this .rows = menu .getRows ();
65
65
}
66
- public MenuIterator ( @ NotNull IterationDirection direction ,
67
- @ NotNull BaseMenu <?> menu ) {
66
+
67
+ public MenuIterator ( @ NotNull IterationDirection direction , @ NotNull BaseMenu menu ) {
68
68
this .menu = menu ;
69
69
this .position = Slot .FIRST .copy ();
70
70
this .direction = direction ;
@@ -78,7 +78,7 @@ public MenuIterator(@NotNull IterationDirection direction,
78
78
* @param emptyOnly a boolean indicating whether to retrieve only empty slots
79
79
* @return the next empty slot in the menu, or null if no empty slot is found
80
80
*/
81
- public Slot nextSlot (boolean emptyOnly ) {
81
+ public @ Nullable Slot nextSlot (boolean emptyOnly ) {
82
82
if (!emptyOnly ) return nextSlot ();
83
83
84
84
while (true ) {
0 commit comments