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