Class SlotIterator.Builder
java.lang.Object
io.github.rysefoxx.inventory.plugin.pagination.SlotIterator.Builder
- Enclosing class:
SlotIterator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull SlotIterator.BuilderblackList(int slot) Adds a slot to the blacklist.@NotNull SlotIterator.BuilderblackList(int @NotNull ... slots) This can be used to block multiple slots.@NotNull SlotIterator.BuilderThis can be used to block multiple slots.build()@NotNull SlotIterator.Buildercopy(@NotNull SlotIterator iterator) Copies the values of the givenSlotIteratorinto this builder.@NotNull SlotIterator.BuilderendPosition(int slot) This tells us where the item should stop.@NotNull SlotIterator.BuilderendPosition(int row, int column) This tells us where the item should stop.@NotNull SlotIterator.Builderoverride()This is used to overwrite items.@NotNull SlotIterator.BuilderstartPosition(int startSlot) Sets the slot to start at.@NotNull SlotIterator.BuilderstartPosition(int row, int column) Sets the slot to start at.@NotNull SlotIterator.Buildertype(@NotNull SlotIterator.SlotIteratorType type) This tells us whether the items should be placed vertically or horizontally.@NotNull SlotIterator.BuilderwithPattern(@NotNull SlotIteratorPattern builder) Using this method, you can decide for yourself how the items should be placed in the inventory.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
copy
Copies the values of the givenSlotIteratorinto this builder.- Parameters:
iterator- theSlotIteratorto copy the values from- Returns:
- The builder object itself.
-
blackList
Adds a slot to the blacklist.- Parameters:
slot- The slot to add to the blacklist.- Returns:
- The builder object itself.
-
blackList
This can be used to block multiple slots.- Parameters:
slots- The slots to be used for the inventory.- Returns:
- The builder object itself.
-
blackList
This can be used to block multiple slots.- Parameters:
slots- The slots to be used for the inventory.- Returns:
- The builder object itself.
-
endPosition
This tells us where the item should stop.- Parameters:
slot- The slot to stop at.- Returns:
- The Builder object itself.
If this method is used,
Pagination.setItemsPerPage(int)is ignored.
-
endPosition
@NotNull public @NotNull SlotIterator.Builder endPosition(@Nonnegative int row, @Nonnegative int column) This tells us where the item should stop.- Parameters:
row- The row to stop at.column- The column to stop at.- Returns:
- The Builder object itself.
If this method is used,
Pagination.setItemsPerPage(int)is ignored.
-
startPosition
Sets the slot to start at.- Parameters:
startSlot- The slot to start at.- Returns:
- The Builder object itself.
-
startPosition
@NotNull public @NotNull SlotIterator.Builder startPosition(@Nonnegative int row, @Nonnegative int column) Sets the slot to start at.- Parameters:
row- The row to start at.column- The column to start at.- Returns:
- The Builder object itself.
-
withPattern
@NotNull public @NotNull SlotIterator.Builder withPattern(@NotNull @NotNull SlotIteratorPattern builder) Using this method, you can decide for yourself how the items should be placed in the inventory.This method has higher priority than #startPosition and #type. If both are used, this method is preferred.
- Parameters:
builder- TheSlotIteratorPatternto use.- Returns:
- The Builder object itself.
-
type
@NotNull public @NotNull SlotIterator.Builder type(@NotNull @NotNull SlotIterator.SlotIteratorType type) This tells us whether the items should be placed vertically or horizontally.- Parameters:
type- The type of the iterator.- Returns:
- The builder object itself.
-
override
This is used to overwrite items.- Returns:
- The Builder object itself.
-
build
-