Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
FireworkMeta.java
1 package org.bukkit.inventory.meta;
2 
3 import java.util.List;
4 
6 import org.bukkit.Material;
7 
8 /**
9  * Represents a {@link Material#FIREWORK} and its effects.
10  */
11 public interface FireworkMeta extends ItemMeta {
12 
13  /**
14  * Add another effect to this firework.
15  *
16  * @param effect The firework effect to add
17  * @throws IllegalArgumentException If effect is null
18  */
19  void addEffect(FireworkEffect effect) throws IllegalArgumentException;
20 
21  /**
22  * Add several effects to this firework.
23  *
24  * @param effects The firework effects to add
25  * @throws IllegalArgumentException If effects is null
26  * @throws IllegalArgumentException If any effect is null (may be thrown
27  * after changes have occurred)
28  */
29  void addEffects(FireworkEffect...effects) throws IllegalArgumentException;
30 
31  /**
32  * Add several firework effects to this firework.
33  *
34  * @param effects An iterable object whose iterator yields the desired
35  * firework effects
36  * @throws IllegalArgumentException If effects is null
37  * @throws IllegalArgumentException If any effect is null (may be thrown
38  * after changes have occurred)
39  */
40  void addEffects(Iterable<FireworkEffect> effects) throws IllegalArgumentException;
41 
42  /**
43  * Get the effects in this firework.
44  *
45  * @return An immutable list of the firework effects
46  */
47  List<FireworkEffect> getEffects();
48 
49  /**
50  * Get the number of effects in this firework.
51  *
52  * @return The number of effects
53  */
54  int getEffectsSize();
55 
56  /**
57  * Remove an effect from this firework.
58  *
59  * @param index The index of the effect to remove
60  * @throws IndexOutOfBoundsException If index < 0 or index > {@link
61  * #getEffectsSize()}
62  */
63  void removeEffect(int index) throws IndexOutOfBoundsException;
64 
65  /**
66  * Remove all effects from this firework.
67  */
68  void clearEffects();
69 
70  /**
71  * Get whether this firework has any effects.
72  *
73  * @return true if it has effects, false if there are no effects
74  */
75  boolean hasEffects();
76 
77  /**
78  * Gets the approximate height the firework will fly.
79  *
80  * @return approximate flight height of the firework.
81  */
82  int getPower();
83 
84  /**
85  * Sets the approximate power of the firework. Each level of power is half
86  * a second of flight time.
87  *
88  * @param power the power of the firework, from 0-128
89  * @throws IllegalArgumentException if height<0 or height>128
90  */
91  void setPower(int power) throws IllegalArgumentException;
92 
93  FireworkMeta clone();
94 }
void addEffects(FireworkEffect...effects)
List< FireworkEffect > getEffects()
void addEffect(FireworkEffect effect)