Package net.glowstone.inventory
Class GlowMetaPotion
java.lang.Object
net.glowstone.inventory.GlowMetaItem
net.glowstone.inventory.GlowMetaPotion
- All Implemented Interfaces:
Cloneable
,org.bukkit.configuration.serialization.ConfigurationSerializable
,org.bukkit.inventory.meta.ItemMeta
,org.bukkit.inventory.meta.PotionMeta
,org.bukkit.persistence.PersistentDataHolder
-
Constructor Summary
ConstructorsConstructorDescriptionGlowMetaPotion
(org.bukkit.inventory.meta.ItemMeta meta) Creates an instance by copying from the givenItemMeta
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addCustomEffect
(@NotNull org.bukkit.potion.PotionEffect effect, boolean overwrite) boolean
@NotNull GlowMetaPotion
clone()
void
copyFrom
(org.bukkit.inventory.meta.PotionMeta source) Copies potion data from another instancestatic String
dataToString
(org.bukkit.potion.PotionData basePotionData) Converts a PotionData to a Potion ID string.static org.bukkit.potion.PotionEffect
fromNbt
(CompoundTag tag) Reads aPotionEffect
from an NBT compound tag.org.bukkit.potion.PotionData
org.bukkit.Color
getColor()
@NotNull List<org.bukkit.potion.PotionEffect>
boolean
hasColor()
boolean
hasCustomEffect
(@NotNull org.bukkit.potion.PotionEffectType type) boolean
boolean
isApplicable
(org.bukkit.Material material) Check whether this ItemMeta can be applied to the given material.boolean
removeCustomEffect
(@NotNull org.bukkit.potion.PotionEffectType type) void
setBasePotionData
(org.bukkit.potion.PotionData basePotionData) void
setColor
(org.bukkit.Color color) boolean
setMainEffect
(@NotNull org.bukkit.potion.PotionEffectType type) static CompoundTag
toNbt
(org.bukkit.potion.PotionEffect effect) Converts aPotionEffect
to an NBT compound tag.Methods inherited from class net.glowstone.inventory.GlowMetaItem
addAttributeModifier, addEnchant, addItemFlags, displayName, displayName, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCanDestroy, getCanPlaceOn, getCustomModelData, getCustomTagContainer, getDestroyableKeys, getDisplayName, getDisplayNameComponent, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, getLoreComponents, getPersistentDataContainer, getPlaceableKeys, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDestroyableKeys, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, hasPlaceableKeys, isUnbreakable, lore, lore, readNbtEnchants, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeItemFlags, serializeEnchants, setAttributeModifiers, setCanDestroy, setCanPlaceOn, setCustomModelData, setDestroyableKeys, setDisplayName, setDisplayNameComponent, setLocalizedName, setLore, setLoreComponents, setPlaceableKeys, setUnbreakable, setVersion, toString, writeNbtEnchants
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.bukkit.inventory.meta.ItemMeta
addAttributeModifier, addEnchant, addItemFlags, displayName, displayName, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCanDestroy, getCanPlaceOn, getCustomModelData, getCustomTagContainer, getDestroyableKeys, getDisplayName, getDisplayNameComponent, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, getLoreComponents, getPlaceableKeys, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDestroyableKeys, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, hasPlaceableKeys, isUnbreakable, lore, lore, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeItemFlags, setAttributeModifiers, setCanDestroy, setCanPlaceOn, setCustomModelData, setDestroyableKeys, setDisplayName, setDisplayNameComponent, setLocalizedName, setLore, setLoreComponents, setPlaceableKeys, setUnbreakable, setVersion
Methods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
-
Constructor Details
-
GlowMetaPotion
public GlowMetaPotion(org.bukkit.inventory.meta.ItemMeta meta) Creates an instance by copying from the givenItemMeta
. If that item is anotherPotionMeta
, its color,PotionData
andPotionEffect
s are copied; otherwise, the new potion has no effects.- Parameters:
meta
- theItemMeta
to copy
-
-
Method Details
-
copyFrom
public void copyFrom(org.bukkit.inventory.meta.PotionMeta source) Copies potion data from another instance- Parameters:
source
- The object to copy from
-
fromNbt
Reads aPotionEffect
from an NBT compound tag.- Parameters:
tag
- a potion effect NBT compound tag- Returns:
tag
as aPotionEffect
-
toNbt
Converts aPotionEffect
to an NBT compound tag.- Parameters:
effect
- the potion effect- Returns:
effect
as an NBT compound tag
-
isApplicable
public boolean isApplicable(org.bukkit.Material material) Description copied from class:GlowMetaItem
Check whether this ItemMeta can be applied to the given material.- Overrides:
isApplicable
in classGlowMetaItem
- Parameters:
material
- The Material.- Returns:
- True if this ItemMeta is applicable.
-
clone
- Specified by:
clone
in interfaceorg.bukkit.inventory.meta.ItemMeta
- Specified by:
clone
in interfaceorg.bukkit.inventory.meta.PotionMeta
- Overrides:
clone
in classGlowMetaItem
-
serialize
- Specified by:
serialize
in interfaceorg.bukkit.configuration.serialization.ConfigurationSerializable
- Overrides:
serialize
in classGlowMetaItem
-
hasCustomEffects
public boolean hasCustomEffects()- Specified by:
hasCustomEffects
in interfaceorg.bukkit.inventory.meta.PotionMeta
-
getCustomEffects
- Specified by:
getCustomEffects
in interfaceorg.bukkit.inventory.meta.PotionMeta
-
addCustomEffect
public boolean addCustomEffect(@NotNull @NotNull org.bukkit.potion.PotionEffect effect, boolean overwrite) - Specified by:
addCustomEffect
in interfaceorg.bukkit.inventory.meta.PotionMeta
-
removeCustomEffect
public boolean removeCustomEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type) - Specified by:
removeCustomEffect
in interfaceorg.bukkit.inventory.meta.PotionMeta
-
hasCustomEffect
public boolean hasCustomEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type) - Specified by:
hasCustomEffect
in interfaceorg.bukkit.inventory.meta.PotionMeta
-
setMainEffect
public boolean setMainEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type) - Specified by:
setMainEffect
in interfaceorg.bukkit.inventory.meta.PotionMeta
-
clearCustomEffects
public boolean clearCustomEffects()- Specified by:
clearCustomEffects
in interfaceorg.bukkit.inventory.meta.PotionMeta
-
hasColor
public boolean hasColor()- Specified by:
hasColor
in interfaceorg.bukkit.inventory.meta.PotionMeta
-
dataToString
Converts a PotionData to a Potion ID string.- Parameters:
basePotionData
- the PotionData to convert- Returns:
- the Potion ID string
-
getBasePotionData
public org.bukkit.potion.PotionData getBasePotionData()- Specified by:
getBasePotionData
in interfaceorg.bukkit.inventory.meta.PotionMeta
-
setBasePotionData
public void setBasePotionData(org.bukkit.potion.PotionData basePotionData) - Specified by:
setBasePotionData
in interfaceorg.bukkit.inventory.meta.PotionMeta
-
getColor
public org.bukkit.Color getColor()- Specified by:
getColor
in interfaceorg.bukkit.inventory.meta.PotionMeta
-
setColor
public void setColor(org.bukkit.Color color) - Specified by:
setColor
in interfaceorg.bukkit.inventory.meta.PotionMeta
-