Class ContentPattern
java.lang.Object
io.github.rysefoxx.inventory.plugin.pattern.ContentPattern
- 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.voidset(char frame, @NotNull IntelligentItem item) Places items in the inventory based on the pattern.voidset(char frame, @NotNull org.bukkit.inventory.ItemStack item) Places items in the inventory based on the pattern.voidset(char frame, @NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type) Places items in the inventory based on the pattern.
-
Constructor Details
-
ContentPattern
-
-
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.
-
set
Places items in the inventory based on the pattern.- Parameters:
frame- The frame to place the items in.item- The item to place.
-
set
public void set(char frame, @NotNull @NotNull org.bukkit.inventory.ItemStack item) Places items in the inventory based on the pattern.- Parameters:
frame- The frame to place the items in.item- The item to place.
-
set
public void set(char frame, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull IntelligentType type) Places items in the inventory based on the pattern.- Parameters:
frame- The frame to place the items in.item- The item to place.type- The type of the item.
-
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.
-