Class SlideAnimation.Builder

java.lang.Object
io.github.rysefoxx.inventory.plugin.animator.SlideAnimation.Builder
Enclosing class:
SlideAnimation

public static class SlideAnimation.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • blockClickEvent

      public SlideAnimation.Builder blockClickEvent()
      This blocks the InventoryClickEvent until the animation is over.
      Returns:
      The Builder to perform further editing.
    • copy

      @NotNull public @NotNull SlideAnimation.Builder copy(@NotNull @NotNull SlideAnimation preset)
      Takes over all properties of the passed animator.
      Parameters:
      preset - The animator to be copied.
      Returns:
      The Builder to perform further editing.

      When copying the animator, the identification is not copied if present!

    • direction

      @NotNull public @NotNull SlideAnimation.Builder direction(@NotNull @NotNull AnimatorDirection direction)
      Defines how the item should be animated in the inventory.
      Parameters:
      direction - The direction of the animation.
      Returns:
      The Builder to perform further editing.
    • delay

      @NotNull public @NotNull SlideAnimation.Builder delay(@Nonnegative int time, @NotNull @NotNull TimeSetting setting)
      Specifies the delay before the animation starts.
      Parameters:
      time - The delay.
      setting - The time setting.
      Returns:
      The Builder to perform further editing.
    • period

      @NotNull public @NotNull SlideAnimation.Builder period(@Nonnegative int time, @NotNull @NotNull TimeSetting setting)
      Sets the speed of the animation in the scheduler.
      Parameters:
      time - The period.
      setting - The time setting.
      Returns:
      The Builder to perform further editing.
    • from

      @NotNull public @NotNull SlideAnimation.Builder from(@Nonnegative int slot) throws IllegalArgumentException
      Adds a single start position.
      Parameters:
      slot - The slot to start at.
      Returns:
      The Builder to perform further editing.
      Throws:
      IllegalArgumentException - if slot is greater than 53
    • from

      @NotNull public @NotNull SlideAnimation.Builder from(@Nonnegative int row, @Nonnegative int column) throws IllegalArgumentException
      Adds a single start position.
      Parameters:
      row - The row to start at.
      column - The column to start at.
      Returns:
      The Builder to perform further editing.
      Throws:
      IllegalArgumentException - if slot greater than 53
    • from

      @NotNull public @NotNull SlideAnimation.Builder from(Integer @NotNull ... slots) throws IllegalArgumentException
      Add multiple start positions.
      Parameters:
      slots - The slots to start at.
      Returns:
      The Builder to perform further editing.
      Throws:
      IllegalArgumentException - if slot is greater than 53
    • from

      @NotNull public @NotNull SlideAnimation.Builder from(Integer @NotNull [] rows, Integer @NotNull [] columns) throws IllegalArgumentException
      Add multiple start positions.
      Parameters:
      rows - The rows to start at.
      columns - The columns to start at.
      Returns:
      The Builder to perform further editing.
      Throws:
      IllegalArgumentException - if row is greater than 5 or if column greater than 8
    • from

      @NotNull public @NotNull SlideAnimation.Builder from(@NotNull @NotNull List<Integer> slots) throws IllegalArgumentException
      Add multiple start positions.
      Parameters:
      slots - The slots to start at.
      Returns:
      The Builder to perform further editing.
      Throws:
      IllegalArgumentException - if slot is greater than 53

      We recommend passing the list from small to large. e.g .from(Arrays.asList(1, 1, 4)) NOT .from(Arrays.asList(4,1,1))

    • from

      @NotNull public @NotNull SlideAnimation.Builder from(@NotNull @NotNull List<Integer> rows, @NotNull @NotNull List<Integer> columns) throws IllegalArgumentException
      Add multiple start positions.
      Parameters:
      rows - The rows to start at.
      columns - The columns to start at.
      Returns:
      The Builder to perform further editing.
      Throws:
      IllegalArgumentException - if row is greater than 5 or if column greater than 8
    • to

      @NotNull public @NotNull SlideAnimation.Builder to(@Nonnegative int slot) throws IllegalArgumentException
      Adds a single end position
      Parameters:
      slot - The slot to end at.
      Returns:
      The Builder to perform further editing.
      Throws:
      IllegalArgumentException - if slot is greater than 53
    • to

      @NotNull public @NotNull SlideAnimation.Builder to(@Nonnegative int row, @Nonnegative int column) throws IllegalArgumentException
      Adds a single end position.
      Parameters:
      row - The row to end at.
      column - The column to end at.
      Returns:
      The Builder to perform further editing.
      Throws:
      IllegalArgumentException - if slot is greater than 53
    • to

      @NotNull public @NotNull SlideAnimation.Builder to(int @NotNull ... slots) throws IllegalArgumentException
      Add multiple end positions.
      Parameters:
      slots - The slots to end at.
      Returns:
      The Builder to perform further editing.
      Throws:
      IllegalArgumentException - if slot is greater than 53
    • to

      @NotNull public @NotNull SlideAnimation.Builder to(Integer @NotNull [] rows, Integer @NotNull [] columns) throws IllegalArgumentException
      Add multiple end positions.
      Parameters:
      rows - The rows to end at.
      columns - The columns to end at.
      Returns:
      The Builder to perform further editing.
      Throws:
      IllegalArgumentException - if row is greater than 5 or if column greater than 8
    • to

      @NotNull public @NotNull SlideAnimation.Builder to(@NotNull @NotNull List<Integer> slots) throws IllegalArgumentException
      Add multiple end positions.
      Parameters:
      slots - The slots to end at.
      Returns:
      The Builder to perform further editing.
      Throws:
      IllegalArgumentException - if slot is greater than 53
    • to

      @NotNull public @NotNull SlideAnimation.Builder to(@NotNull @NotNull List<Integer> rows, @NotNull @NotNull List<Integer> columns) throws IllegalArgumentException
      Add multiple end positions.
      Parameters:
      rows - The rows to end at.
      columns - The columns to end at.
      Returns:
      The Builder to perform further editing.
      Throws:
      IllegalArgumentException - if row is greater than 5 or if column greater than 8
    • item

      @NotNull public @NotNull SlideAnimation.Builder item(@NotNull @NotNull IntelligentItem item)
      Add an item, which will appear animated in the inventory.
      Parameters:
      item - The item to add.
      Returns:
      The Builder to perform further editing.
    • item

      @NotNull public @NotNull SlideAnimation.Builder item(IntelligentItem @NotNull ... items)
      Add multiple items that will appear animated in the inventory.
      Parameters:
      items - The items to add.
      Returns:
      The Builder to perform further editing.
    • items

      @NotNull public @NotNull SlideAnimation.Builder items(IntelligentItem @NotNull ... items)
      Add multiple items that will appear animated in the inventory.
      Parameters:
      items - The items to add.
      Returns:
      The Builder to perform further editing.
    • item

      @NotNull public @NotNull SlideAnimation.Builder item(@NotNull @NotNull List<IntelligentItem> items)
      Add multiple items that will appear animated in the inventory.
      Parameters:
      items - The items to add.
      Returns:
      The Builder to perform further editing.
    • items

      @NotNull public @NotNull SlideAnimation.Builder items(@NotNull @NotNull List<IntelligentItem> items)
      Add multiple items that will appear animated in the inventory.
      Parameters:
      items - The items to add.
      Returns:
      The Builder to perform further editing.
    • identifier

      @NotNull public @NotNull SlideAnimation.Builder identifier(@NotNull @NotNull Object identifier)
      Gives the Animation an identification
      Parameters:
      identifier - The ID through which you can get the animation
      Returns:
      The Builder to perform further editing
    • build

      This creates the animation class but does not start it yet! SlideAnimation.animate(InventoryContents)
      Returns:
      The animation class
      Throws:
      IllegalArgumentException - if no start position was specified, if no end position was specified, if period is empty or if items is empty.
      IllegalStateException - if manager is null
      NullPointerException - if direction is null.