Class SlideAnimation.Builder
java.lang.Object
io.github.rysefoxx.inventory.plugin.animator.SlideAnimation.Builder
- Enclosing class:
SlideAnimation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis blocks the InventoryClickEvent until the animation is over.build()This creates the animation class but does not start it yet!@NotNull SlideAnimation.Buildercopy(@NotNull SlideAnimation preset) Takes over all properties of the passed animator.@NotNull SlideAnimation.Builderdelay(int time, @NotNull TimeSetting setting) Specifies the delay before the animation starts.@NotNull SlideAnimation.Builderdirection(@NotNull AnimatorDirection direction) Defines how the item should be animated in the inventory.@NotNull SlideAnimation.Builderfrom(int slot) Adds a single start position.@NotNull SlideAnimation.Builderfrom(int row, int column) Adds a single start position.@NotNull SlideAnimation.BuilderAdd multiple start positions.@NotNull SlideAnimation.BuilderAdd multiple start positions.@NotNull SlideAnimation.BuilderAdd multiple start positions.@NotNull SlideAnimation.BuilderAdd multiple start positions.@NotNull SlideAnimation.Builderidentifier(@NotNull Object identifier) Gives the Animation an identification@NotNull SlideAnimation.Builderitem(@NotNull IntelligentItem item) Add an item, which will appear animated in the inventory.@NotNull SlideAnimation.Builderitem(@NotNull List<IntelligentItem> items) Add multiple items that will appear animated in the inventory.@NotNull SlideAnimation.Builderitem(IntelligentItem @NotNull ... items) Add multiple items that will appear animated in the inventory.@NotNull SlideAnimation.Builderitems(@NotNull List<IntelligentItem> items) Add multiple items that will appear animated in the inventory.@NotNull SlideAnimation.Builderitems(IntelligentItem @NotNull ... items) Add multiple items that will appear animated in the inventory.@NotNull SlideAnimation.Builderperiod(int time, @NotNull TimeSetting setting) Sets the speed of the animation in the scheduler.@NotNull SlideAnimation.Builderto(int slot) Adds a single end position@NotNull SlideAnimation.Builderto(int @NotNull ... slots) Add multiple end positions.@NotNull SlideAnimation.Builderto(int row, int column) Adds a single end position.@NotNull SlideAnimation.BuilderAdd multiple end positions.@NotNull SlideAnimation.BuilderAdd multiple end positions.@NotNull SlideAnimation.BuilderAdd multiple end positions.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
blockClickEvent
This blocks the InventoryClickEvent until the animation is over.- Returns:
- The Builder to perform further editing.
-
copy
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 53We 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
Add an item, which will appear animated in the inventory.- Parameters:
item- The item to add.- Returns:
- The Builder to perform further editing.
-
item
Add multiple items that will appear animated in the inventory.- Parameters:
items- The items to add.- Returns:
- The Builder to perform further editing.
-
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
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
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 nullNullPointerException- if direction is null.
-