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