public interface PotionMeta extends ItemMeta
限定符和类型 | 方法和说明 |
---|---|
boolean |
addCustomEffect(PotionEffect effect,
boolean overwrite)
添加一个自定义药水效果到这个药水上.
|
boolean |
clearCustomEffects()
移除这个药水的全部自定义药水效果.
|
PotionMeta |
clone() |
PotionData |
getBasePotionData()
返回关于这个基础药水的药水数据.
|
Color |
getColor()
Gets the potion color that is set.
|
java.util.List<PotionEffect> |
getCustomEffects()
获取包含了这个药水存在的所有药水效果的一个不可变的列表.
|
boolean |
hasColor()
Checks for existence of a potion color.
|
boolean |
hasCustomEffect(PotionEffectType type)
Checks for a specific custom potion effect type on this potion.
|
boolean |
hasCustomEffects()
检测这个药水是否存在药水效果.
|
boolean |
removeCustomEffect(PotionEffectType type)
移除这个药水的一个自定义效果.
|
void |
setBasePotionData(PotionData data)
设置基础药水数据.
|
void |
setColor(Color color)
Sets the potion color.
|
boolean |
setMainEffect(PotionEffectType type)
|
addEnchant, addItemFlags, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, hasConflictingEnchant, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, isUnbreakable, removeEnchant, removeItemFlags, setDisplayName, setLocalizedName, setLore, setUnbreakable
serialize
void setBasePotionData(PotionData data)
原文:Sets the underlying potion data
data
- PotionData设置基础药水状态的PotionDataPotionData getBasePotionData()
原文:Returns the potion data about the base potion
boolean hasCustomEffects()
原文:Checks for the presence of custom potion effects.
java.util.List<PotionEffect> getCustomEffects()
插件应该在调用这个方法之前检查hasCustomEffects()是否返回true.
原文:Gets an immutable list containing all custom potion effects applied to this potion.
Plugins should check that hasCustomEffects() returns true before calling this method.
boolean addCustomEffect(PotionEffect effect, boolean overwrite)
原文:Adds a custom potion effect to this potion.
effect
- 要添加的药水效果overwrite
- 如果有相同类型的效果存在想要覆盖就设为trueboolean removeCustomEffect(PotionEffectType type)
原文:Removes a custom potion effect from this potion.
type
- 要移除的药水效果类型boolean hasCustomEffect(PotionEffectType type)
type
- the potion effect type to check for@Deprecated boolean setMainEffect(PotionEffectType type)
这将会使客户端上的药水名称显示成设置的药水效果.
译注:第一句不好理解?比如有三个效果,有个效果在最后面是最主要的效果,我们就可以把这个效果移动到最顶上,这样玩家第一眼看到的就是这个效果啦.
原文:Moves a potion effect to the top of the potion effect list.
This causes the client to display the potion effect in the potion's name.
type
- 要移动的药水效果boolean clearCustomEffects()
原文:Removes all custom potion effects from this potion.
boolean hasColor()
Color getColor()
Plugins should check that hasColor() returns true
before
calling this method.
void setColor(Color color)
color
- the color to setPotionMeta clone()