public static final class FireworkEffect.Builder extends Object
FireworkEffect.builder()
Modifier and Type | Method | Description |
---|---|---|
@NotNull FireworkEffect |
build() |
Create a
FireworkEffect from the current contents of this
builder. |
@NotNull FireworkEffect.Builder |
flicker(boolean flicker) |
Set whether the firework effect should flicker.
|
@NotNull FireworkEffect.Builder |
trail(boolean trail) |
Set whether the firework effect should have a trail.
|
@NotNull FireworkEffect.Builder |
with(@NotNull FireworkEffect.Type type) |
Specify the type of the firework effect.
|
@NotNull FireworkEffect.Builder |
withColor(@NotNull Iterable<?> colors) |
Add several primary colors to the firework effect.
|
@NotNull FireworkEffect.Builder |
withColor(@NotNull Color color) |
Add a primary color to the firework effect.
|
@NotNull FireworkEffect.Builder |
withColor(@NotNull Color... colors) |
Add several primary colors to the firework effect.
|
@NotNull FireworkEffect.Builder |
withFade(@NotNull Iterable<?> colors) |
Add several fade colors to the firework effect.
|
@NotNull FireworkEffect.Builder |
withFade(@NotNull Color color) |
Add a fade color to the firework effect.
|
@NotNull FireworkEffect.Builder |
withFade(@NotNull Color... colors) |
Add several fade colors to the firework effect.
|
@NotNull FireworkEffect.Builder |
withFlicker() |
Add a flicker to the firework effect.
|
@NotNull FireworkEffect.Builder |
withTrail() |
Add a trail to the firework effect.
|
@NotNull public @NotNull FireworkEffect.Builder with(@NotNull @NotNull FireworkEffect.Type type) throws IllegalArgumentException
type
- The effect typeIllegalArgumentException
- If type is null@NotNull public @NotNull FireworkEffect.Builder withFlicker()
@NotNull public @NotNull FireworkEffect.Builder flicker(boolean flicker)
flicker
- true if it should flicker, false if not@NotNull public @NotNull FireworkEffect.Builder withTrail()
@NotNull public @NotNull FireworkEffect.Builder trail(boolean trail)
trail
- true if it should have a trail, false for no trail@NotNull public @NotNull FireworkEffect.Builder withColor(@NotNull @NotNull Color color) throws IllegalArgumentException
color
- The color to addIllegalArgumentException
- If color is null@NotNull public @NotNull FireworkEffect.Builder withColor(@NotNull @NotNull Color... colors) throws IllegalArgumentException
colors
- The colors to addIllegalArgumentException
- If colors is nullIllegalArgumentException
- If any color is null (may be
thrown after changes have occurred)@NotNull public @NotNull FireworkEffect.Builder withColor(@NotNull @NotNull Iterable<?> colors) throws IllegalArgumentException
colors
- An iterable object whose iterator yields the desired
colorsIllegalArgumentException
- If colors is nullIllegalArgumentException
- If any color is null (may be
thrown after changes have occurred)@NotNull public @NotNull FireworkEffect.Builder withFade(@NotNull @NotNull Color color) throws IllegalArgumentException
color
- The color to addIllegalArgumentException
- If colors is nullIllegalArgumentException
- If any color is null (may be
thrown after changes have occurred)@NotNull public @NotNull FireworkEffect.Builder withFade(@NotNull @NotNull Color... colors) throws IllegalArgumentException
colors
- The colors to addIllegalArgumentException
- If colors is nullIllegalArgumentException
- If any color is null (may be
thrown after changes have occurred)@NotNull public @NotNull FireworkEffect.Builder withFade(@NotNull @NotNull Iterable<?> colors) throws IllegalArgumentException
colors
- An iterable object whose iterator yields the desired
colorsIllegalArgumentException
- If colors is nullIllegalArgumentException
- If any color is null (may be
thrown after changes have occurred)@NotNull public @NotNull FireworkEffect build()
FireworkEffect
from the current contents of this
builder.
To successfully build, you must have specified at least one color.
Copyright © 2020. All rights reserved.