接口 FireworkMeta
烟花火箭及其效果.-
方法概要
修饰符和类型方法说明voidaddEffect(@NotNull FireworkEffect effect) 向烟花火箭添加一个烟花效果.voidaddEffects(@NotNull Iterable<FireworkEffect> effects) 向烟花火箭添加多个烟花效果.voidaddEffects(@NotNull FireworkEffect... effects) 向烟花火箭添加多个烟花效果.void移除烟花火箭附带的所有效果.clone()获取此烟花火箭的所有烟花效果.int获取烟花效果的数量.intgetPower()获取这个烟花火箭的飞行时间的近似值.boolean判断烟花火箭是否含有烟花效果.booleanhasPower()判断这个烟花火箭是否含有能量.voidremoveEffect(int index) 移除烟花火箭中的一个烟花效果.voidsetPower(int power) 设置这个烟花火箭的飞行时间的近似值.从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable
serialize从接口继承的方法 org.bukkit.inventory.meta.ItemMeta
addAttributeModifier, addEnchant, addItemFlags, getAsComponentString, getAsString, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getBlocksAttacks, getBreakSound, getConsumable, getCustomModelData, getCustomModelDataComponent, getCustomTagContainer, getDamageResistant, getDisplayName, getEnchantable, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getEquippable, getFood, getItemFlags, getItemModel, getItemName, getJukeboxPlayable, getLocalizedName, getLore, getMaxStackSize, getRarity, getTool, getTooltipStyle, getUseCooldown, getUseRemainder, getWeapon, hasAttributeModifiers, hasBlocksAttacks, hasBreakSound, hasConflictingEnchant, hasConsumable, hasCustomModelData, hasCustomModelDataComponent, hasDamageResistant, hasDisplayName, hasEnchant, hasEnchantable, hasEnchantmentGlintOverride, hasEnchants, hasEquippable, hasFood, hasItemFlag, hasItemModel, hasItemName, hasJukeboxPlayable, hasLocalizedName, hasLore, hasMaxStackSize, hasRarity, hasTool, hasTooltipStyle, hasUseCooldown, hasUseRemainder, hasWeapon, isFireResistant, isGlider, isHideTooltip, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchantments, removeItemFlags, setAttributeModifiers, setBlocksAttacks, setBreakSound, setConsumable, setCustomModelData, setCustomModelDataComponent, setDamageResistant, setDisplayName, setEnchantable, setEnchantmentGlintOverride, setEquippable, setFireResistant, setFood, setGlider, setHideTooltip, setItemModel, setItemName, setJukeboxPlayable, setLocalizedName, setLore, setMaxStackSize, setRarity, setTool, setTooltipStyle, setUnbreakable, setUseCooldown, setUseRemainder, setVersion, setWeapon从接口继承的方法 org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
-
方法详细资料
-
addEffect
向烟花火箭添加一个烟花效果.原文: Add another effect to this firework.
- 参数:
effect- 要添加的烟花效果- 抛出:
IllegalArgumentException- 若 effect 为 null
-
addEffects
向烟花火箭添加多个烟花效果.原文: Add several effects to this firework.
- 参数:
effects- 要添加的烟花效果- 抛出:
IllegalArgumentException- 若 effects 为 nullIllegalArgumentException- 若任意一个效果为 null (可能在前面的效果应用后抛出)
-
addEffects
向烟花火箭添加多个烟花效果.原文: Add several firework effects to this firework.
- 参数:
effects- 一个可以迭代所需的烟花效果的可迭代对象- 抛出:
IllegalArgumentException- 若 effects 为 nullIllegalArgumentException- 若任意一个效果为 null (可能在前面的效果应用后抛出)
-
getEffects
获取此烟花火箭的所有烟花效果.原文: Get the effects in this firework.
- 返回:
- 所有烟花效果的不可变列表
-
getEffectsSize
int getEffectsSize()获取烟花效果的数量.原文: Get the number of effects in this firework.
- 返回:
- 烟花效果的数量
-
removeEffect
移除烟花火箭中的一个烟花效果.原文: Remove an effect from this firework.
- 参数:
index- 烟花效果的序号- 抛出:
IndexOutOfBoundsException- 若 index < 0 或 index >getEffectsSize()
-
clearEffects
void clearEffects()移除烟花火箭附带的所有效果.原文: Remove all effects from this firework.
-
hasEffects
boolean hasEffects()判断烟花火箭是否含有烟花效果.原文: Get whether this firework has any effects.
- 返回:
- 烟花火箭是否含有烟花效果.
-
hasPower
boolean hasPower()判断这个烟花火箭是否含有能量.原文:Get whether this firework has power set by component.
- 返回:
- 是否含有能量
-
getPower
int getPower()获取这个烟花火箭的飞行时间的近似值.
插件调用此方法前应检查 hasPower() 是否返回true.译注: 原文中 "height" 有误, 实际为飞行时间而非高度, 但"近似"表述无误, 因为底层的烟花生命周期(单位为 tick)的计算公式为:
飞行时间 * 10 + 0~5的随机整数 + 0~6的随机整数.原文:Gets the approximate height the firework will fly.
Plugins should check that hasPower() returnstruebefore calling this method.- 返回:
- 飞行时间近似值
- 另请参阅:
-
setPower
设置这个烟花火箭的飞行时间的近似值. 每一级能量大约是半秒的飞行时间.原文: Sets the approximate power of the firework. Each level of power is half a second of flight time.
- 参数:
power- 烟花火箭的能量 (持续时间), 取值范围 0 <= power <= 255- 抛出:
IllegalArgumentException- 若 power<0 或 power>255
-
clone
-