Class IntelligentItemNameAnimator.Builder
java.lang.Object
io.github.rysefoxx.inventory.plugin.animator.IntelligentItemNameAnimator.Builder
- Enclosing class:
IntelligentItemNameAnimator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull IntelligentItemNameAnimatorbuild(@NotNull InventoryContents contents) This creates the animation class but does not start it yet!@NotNull IntelligentItemNameAnimator.Buildercolor(char frame, @NotNull IntelligentItemColor color) Assigns a color to a frame.@NotNull IntelligentItemNameAnimator.Buildercolors(@NotNull List<Character> frames, IntelligentItemColor @NotNull ... color) Several frames are assigned individual colors.@NotNull IntelligentItemNameAnimator.Buildercolors(Character @NotNull [] frames, @NotNull List<IntelligentItemColor> color) Several frames are assigned individual colors.@NotNull IntelligentItemNameAnimator.Buildercolors(Character @NotNull [] frames, IntelligentItemColor @NotNull ... color) Several frames are assigned individual colors.@NotNull IntelligentItemNameAnimator.Buildercopy(@NotNull IntelligentItemNameAnimator preset) Takes over all properties of the passed animator.@NotNull IntelligentItemNameAnimator.Builderdelay(int time, @NotNull TimeSetting setting) Specifies the delay before the animation starts.@NotNull IntelligentItemNameAnimator.BuilderAdds another frame.@NotNull IntelligentItemNameAnimator.BuilderAdds several frames.@NotNull IntelligentItemNameAnimator.BuilderAdds several frames.@NotNull IntelligentItemNameAnimator.Builderidentifier(@NotNull Object identifier) Gives the Animation an identification@NotNull IntelligentItemNameAnimator.Builderitem(@NotNull IntelligentItem intelligentItem) This tells which item is to be animated.@NotNull IntelligentItemNameAnimator.Builderloop()Keeps the animation running until the player closes the inventory.@NotNull IntelligentItemNameAnimator.Builderperiod(int time, @NotNull TimeSetting setting) Sets the speed of the animation in the scheduler.@NotNull IntelligentItemNameAnimator.Builderslot(int slot) This tells us in which slot the animation should take place.@NotNull IntelligentItemNameAnimator.Buildertype(@NotNull IntelligentItemAnimatorType type) Decides how the name of the item should be animated.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
item
@NotNull public @NotNull IntelligentItemNameAnimator.Builder item(@NotNull @NotNull IntelligentItem intelligentItem) This tells which item is to be animated.- Parameters:
intelligentItem- The item that is to be animated.- Returns:
- The Builder to perform further editing.
-
copy
@NotNull public @NotNull IntelligentItemNameAnimator.Builder copy(@NotNull @NotNull IntelligentItemNameAnimator preset) Takes over all properties of the passed animator.- Parameters:
preset- The animator to be copied.- Returns:
- The Builder to perform further editing.
-
loop
Keeps the animation running until the player closes the inventory.- Returns:
- The Builder to perform further editing.
-
type
@NotNull public @NotNull IntelligentItemNameAnimator.Builder type(@NotNull @NotNull IntelligentItemAnimatorType type) Decides how the name of the item should be animated.- Parameters:
type- The animation type- Returns:
- The Builder to perform further editing.
-
slot
@NotNull public @NotNull IntelligentItemNameAnimator.Builder slot(@Nonnegative int slot) throws IllegalArgumentException This tells us in which slot the animation should take place.- Parameters:
slot- The slot to be animated.- Returns:
- The Builder to perform further editing.
- Throws:
IllegalArgumentException- if slot is greater than 53
-
color
@NotNull public @NotNull IntelligentItemNameAnimator.Builder color(char frame, @NotNull @NotNull IntelligentItemColor color) Assigns a color to a frame.- Parameters:
frame- The frame that should receive the color.color- The color you want the frame to have.- Returns:
- The Builder to perform further editing.
-
colors
@NotNull public @NotNull IntelligentItemNameAnimator.Builder colors(@NotNull @NotNull List<Character> frames, IntelligentItemColor @NotNull ... color) throws IllegalArgumentException Several frames are assigned individual colors.- Parameters:
frames- The frames that should receive the color.color- The color you want the frames to have.- Returns:
- The Builder to perform further editing.
- Throws:
IllegalArgumentException- If the parameters are not equal.
-
colors
@NotNull public @NotNull IntelligentItemNameAnimator.Builder colors(Character @NotNull [] frames, IntelligentItemColor @NotNull ... color) Several frames are assigned individual colors.- Parameters:
frames- The frames that should receive the color.color- The color you want the frames to have.- Returns:
- The Builder to perform further editing.
- Throws:
IllegalArgumentException- If the parameters are not equal.
-
colors
@NotNull public @NotNull IntelligentItemNameAnimator.Builder colors(Character @NotNull [] frames, @NotNull @NotNull List<IntelligentItemColor> color) Several frames are assigned individual colors.- Parameters:
frames- The frames that should receive the color.color- The color you want the frames to have.- Returns:
- The Builder to perform further editing.
- Throws:
IllegalArgumentException- If the parameters are not equal.
-
frame
@NotNull public @NotNull IntelligentItemNameAnimator.Builder frame(@NotNull @NotNull String frame) throws IllegalArgumentException Adds another frame.- Parameters:
frame- The frame to be added.- Returns:
- The Builder to perform further editing.
- Throws:
IllegalArgumentException- If no color has been assigned to the frame yet. e.gcolors(List, IntelligentItemColor...)
-
frames
Adds several frames.- Parameters:
frames- The frames to be added.- Returns:
- The Builder to perform further editing.
- Throws:
IllegalArgumentException- If no color has been assigned to the frame yet. e.gcolors(List, IntelligentItemColor...)
-
frames
@NotNull public @NotNull IntelligentItemNameAnimator.Builder frames(@NotNull @NotNull List<String> frames) Adds several frames.- Parameters:
frames- The frames to be added.- Returns:
- The Builder to perform further editing.
- Throws:
IllegalArgumentException- If no color has been assigned to the frame yet. e.gcolors(List, IntelligentItemColor...)
-
period
@NotNull public @NotNull IntelligentItemNameAnimator.Builder period(@Nonnegative int time, @NotNull @NotNull TimeSetting setting) Sets the speed of the animation in the scheduler.- Parameters:
time- The time.setting- The time setting.- Returns:
- The Builder to perform further editing.
-
delay
@NotNull public @NotNull IntelligentItemNameAnimator.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.
-
identifier
@NotNull public @NotNull IntelligentItemNameAnimator.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
When copying the animator, the identification is not copied if present!
-
build
@NotNull public @NotNull IntelligentItemNameAnimator build(@NotNull @NotNull InventoryContents contents) throws IllegalArgumentException, NullPointerException This creates the animation class but does not start it yet!IntelligentItemNameAnimator.animate()- Parameters:
contents- The contents of the inventory.- Returns:
- The animation class
- Throws:
IllegalArgumentException- if no slot was specified, if frameColor is empty, if frames is empty or if no color has been assigned to a frame.NullPointerException- if item is null.
-