Class SearchPattern
java.lang.Object
io.github.rysefoxx.inventory.plugin.pattern.SearchPattern
- Since:
- 6/11/2022
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDefines the pattern to be searched for.voidDefines the pattern to be searched for.@NotNull List<IntelligentItem>searchForIntelligentItems(char frame) Method to search all IntelligentItems based on the frame.@NotNull List<org.bukkit.inventory.ItemStack>searchForItemStacks(char frame) Method to search all ItemStacks based on the frame.
-
Constructor Details
-
SearchPattern
-
-
Method Details
-
define
Defines the pattern to be searched for.- Parameters:
lines- The lines of the pattern.- Throws:
IllegalArgumentException- If the line length is not 9.
-
define
public void define(@NotNull @NotNull String line, @Nonnegative int amount) throws IllegalArgumentException Defines the pattern to be searched for.- Parameters:
line- The line of the pattern.amount- How often this pattern should be repeated.- Throws:
IllegalArgumentException- If the line length is not 9 or the amount is higher than 6.
-
searchForIntelligentItems
@NotNull public @NotNull List<IntelligentItem> searchForIntelligentItems(char frame) throws IllegalStateException Method to search all IntelligentItems based on the frame.- Parameters:
frame- The frame to search for.- Returns:
- A list of IntelligentItems that match the frame.
- Throws:
IllegalStateException- If no pattern have been defined.
-
searchForItemStacks
@NotNull public @NotNull List<org.bukkit.inventory.ItemStack> searchForItemStacks(char frame) throws IllegalStateException Method to search all ItemStacks based on the frame.- Parameters:
frame- The frame to search for.- Returns:
- A list of IntelligentItems that match the frame.
- Throws:
IllegalStateException- If no pattern have been defined.
-
getPattern
@NotNull public @Unmodifiable @NotNull List<String> getPattern() throws UnsupportedOperationException- Returns:
- The pattern specified in the
define(String...)method. - Throws:
UnsupportedOperationException- If list gets modified.
-