Class ContentPattern

java.lang.Object
io.github.rysefoxx.pattern.ContentPattern

public class ContentPattern extends Object
Since:
6/11/2022
  • Constructor Summary

    Constructors
    Constructor
    Description
    ContentPattern​(@NotNull InventoryContents contents)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    define​(@NotNull String line, int amount)
    Defines the pattern to be searched for.
    void
    define​(String @NotNull ... lines)
    Defines the pattern to be searched for.
    @NotNull List<String>
     
    void
    set​(char frame, @NotNull IntelligentItem item)
    Places items in the inventory based on the pattern.
    void
    set​(char frame, @NotNull org.bukkit.inventory.ItemStack item)
    Places items in the inventory based on the pattern.
    void
    set​(char frame, @NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type)
    Places items in the inventory based on the pattern.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ContentPattern

      public ContentPattern(@NotNull @NotNull InventoryContents contents)
  • Method Details

    • define

      public void define(String @NotNull ... lines) throws IllegalArgumentException
      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

      public void set(char frame, @NotNull @NotNull IntelligentItem 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)
      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 @NotNull List<String> getPattern()
      Returns:
      The pattern specified in the define(String...) method.