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