接口 PotionMeta
-
方法概要
修饰符和类型方法说明boolean
addCustomEffect
(@NotNull PotionEffect effect, boolean overwrite) 向此药水添加一个自定义药水效果.boolean
移除这个药水的全部自定义药水效果.clone()
已过时。返回关于这个基础药水(主药水)的药水类型.getColor()
获取为这瓶药水设置的颜色.获取这个药水的全部自定义效果.boolean
Checks for the presence of a base potion typeboolean
hasColor()
检查药水是否设置了自定义颜色.boolean
检查这个药水是否有指定的药水效果.boolean
检测这个药水是否存在药水效果.boolean
移除这个药水的一个自定义效果.void
已过时。Upgraded / extended potions are now their ownPotionType
usesetBasePotionType(org.bukkit.potion.PotionType)
instead.void
设置基础药水(主药水)的类型.void
设置药水的颜色.boolean
从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
从接口继承的方法 org.bukkit.inventory.meta.ItemMeta
addAttributeModifier, addEnchant, addItemFlags, getAsComponentString, getAsString, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getCustomTagContainer, getDisplayName, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getFood, getItemFlags, getItemName, getJukeboxPlayable, getLocalizedName, getLore, getMaxStackSize, getRarity, getTool, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDisplayName, hasEnchant, hasEnchantmentGlintOverride, hasEnchants, hasFood, hasItemFlag, hasItemName, hasJukeboxPlayable, hasLocalizedName, hasLore, hasMaxStackSize, hasRarity, hasTool, isFireResistant, isHideTooltip, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchantments, removeItemFlags, setAttributeModifiers, setCustomModelData, setDisplayName, setEnchantmentGlintOverride, setFireResistant, setFood, setHideTooltip, setItemName, setJukeboxPlayable, setLocalizedName, setLore, setMaxStackSize, setRarity, setTool, setUnbreakable, setVersion
从接口继承的方法 org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
-
方法详细资料
-
setBasePotionData
已过时。Upgraded / extended potions are now their ownPotionType
usesetBasePotionType(org.bukkit.potion.PotionType)
instead.Sets the underlying potion data- 参数:
data
- PotionData to set the base potion state to
-
getBasePotionData
已过时。Upgraded / extended potions are now their ownPotionType
usegetBasePotionType()
instead.Returns the potion data about the base potion- 返回:
- a PotionData object
-
setBasePotionType
设置基础药水(主药水)的类型.原文: Sets the underlying potion type
- 参数:
type
- 基础药水类型
-
getBasePotionType
返回关于这个基础药水(主药水)的药水类型.原文: Returns the potion type about the base potion
- 返回:
- PotionType 对象
-
hasBasePotionType
boolean hasBasePotionType()Checks for the presence of a base potion type- 返回:
- true if a base potion type is present
-
hasCustomEffects
boolean hasCustomEffects()检测这个药水是否存在药水效果.原文: Checks for the presence of custom potion effects.
- 返回:
- 这个药水是否存在药水效果
-
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.
- 返回:
- 自定义效果列表 (不可变)
-
addCustomEffect
向此药水添加一个自定义药水效果.原文: Adds a custom potion effect to this potion.
- 参数:
effect
- 要添加的药水效果overwrite
- 如要覆盖已有的同类药水效果就设为 true- 返回:
- 如果药水的属性改变了则为 true
-
removeCustomEffect
移除这个药水的一个自定义效果.原文: Removes a custom potion effect from this potion.
- 参数:
type
- 要移除的药水效果类型- 返回:
- 如果药水的属性改变了则为 true
-
hasCustomEffect
检查这个药水是否有指定的药水效果.原文: Checks for a specific custom potion effect type on this potion.
- 参数:
type
- 要检查的药水效果- 返回:
- 存在此药水效果则返回 true
-
setMainEffect
移动一个药水效果至这个药水效果列表的顶端.这将会使客户端上的药水名称显示成设置的药水效果.
译注: 第一句不好理解? 比如有三个效果, 有个效果在最后面是最主要的效果, 我们就可以把这个效果移动到最顶上, 这样玩家第一眼看到的就是这个效果啦.
原文: 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
- 要移动的药水效果- 返回:
- 如果药水的属性改变了则为 true
-
clearCustomEffects
boolean clearCustomEffects()移除这个药水的全部自定义药水效果.原文: Removes all custom potion effects from this potion.
- 返回:
- 如果药水的属性改变了则为 true
-
hasColor
boolean hasColor()检查药水是否设置了自定义颜色.原文: Checks for existence of a potion color.
- 返回:
- 是否设置了自定义颜色
-
getColor
获取为这瓶药水设置的颜色. 此颜色可在物品栏中药水物品的格子内观察到.插件应该在调用这个方法之前检查 hasColor() 是否返回
true
.原文: Gets the potion color that is set. A custom potion color will alter the display of the potion in an inventory slot.
Plugins should check that hasColor() returns
true
before calling this method.- 返回:
- 药水颜色
-
setColor
设置药水的颜色. 此颜色可在物品栏中药水物品的格子内观察到.原文: Sets the potion color. A custom potion color will alter the display of the potion in an inventory slot.
- 参数:
color
- 颜色
-
clone
PotionMeta clone()
-
PotionType
usegetBasePotionType()
instead.