Package org.bukkit.inventory.meta
Interface FireworkMeta
-
- All Superinterfaces:
Cloneable
,ConfigurationSerializable
,ItemMeta
,PersistentDataHolder
public interface FireworkMeta extends ItemMeta
Represents aMaterial.FIREWORK_ROCKET
and its effects.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.bukkit.inventory.meta.ItemMeta
ItemMeta.Spigot
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addEffect(FireworkEffect effect)
Add another effect to this firework.void
addEffects(Iterable<FireworkEffect> effects)
Add several firework effects to this firework.void
addEffects(FireworkEffect... effects)
Add several effects to this firework.void
clearEffects()
Remove all effects from this firework.FireworkMeta
clone()
List<FireworkEffect>
getEffects()
Get the effects in this firework.int
getEffectsSize()
Get the number of effects in this firework.int
getPower()
Gets the approximate height the firework will fly.boolean
hasEffects()
Get whether this firework has any effects.void
removeEffect(int index)
Remove an effect from this firework.void
setPower(int power)
Sets the approximate power of the firework.-
Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
-
Methods inherited from interface org.bukkit.inventory.meta.ItemMeta
addAttributeModifier, addEnchant, addItemFlags, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getCustomTagContainer, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeItemFlags, setAttributeModifiers, setCustomModelData, setDisplayName, setLocalizedName, setLore, setUnbreakable, setVersion, spigot
-
Methods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
-
-
-
-
Method Detail
-
addEffect
void addEffect(@NotNull FireworkEffect effect) throws IllegalArgumentException
Add another effect to this firework.- Parameters:
effect
- The firework effect to add- Throws:
IllegalArgumentException
- If effect is null
-
addEffects
void addEffects(@NotNull FireworkEffect... effects) throws IllegalArgumentException
Add several effects to this firework.- Parameters:
effects
- The firework effects to add- Throws:
IllegalArgumentException
- If effects is nullIllegalArgumentException
- If any effect is null (may be thrown after changes have occurred)
-
addEffects
void addEffects(@NotNull Iterable<FireworkEffect> effects) throws IllegalArgumentException
Add several firework effects to this firework.- Parameters:
effects
- An iterable object whose iterator yields the desired firework effects- Throws:
IllegalArgumentException
- If effects is nullIllegalArgumentException
- If any effect is null (may be thrown after changes have occurred)
-
getEffects
@NotNull List<FireworkEffect> getEffects()
Get the effects in this firework.- Returns:
- An immutable list of the firework effects
-
getEffectsSize
int getEffectsSize()
Get the number of effects in this firework.- Returns:
- The number of effects
-
removeEffect
void removeEffect(int index) throws IndexOutOfBoundsException
Remove an effect from this firework.- Parameters:
index
- The index of the effect to remove- Throws:
IndexOutOfBoundsException
- If index < 0 or index >getEffectsSize()
-
clearEffects
void clearEffects()
Remove all effects from this firework.
-
hasEffects
boolean hasEffects()
Get whether this firework has any effects.- Returns:
- true if it has effects, false if there are no effects
-
getPower
int getPower()
Gets the approximate height the firework will fly.- Returns:
- approximate flight height of the firework.
-
setPower
void setPower(int power) throws IllegalArgumentException
Sets the approximate power of the firework. Each level of power is half a second of flight time.- Parameters:
power
- the power of the firework, from 0-128- Throws:
IllegalArgumentException
- if height<0 or height>128
-
clone
@NotNull FireworkMeta clone()
-
-