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 TypeMethodDescriptionbooleanaddCustomEffect(@NotNull org.bukkit.potion.PotionEffect effect, boolean overwrite) boolean@NotNull GlowMetaPotionclone()voidcopyFrom(org.bukkit.inventory.meta.PotionMeta source) Copies potion data from another instancestatic StringdataToString(org.bukkit.potion.PotionData basePotionData) Converts a PotionData to a Potion ID string.static org.bukkit.potion.PotionEffectfromNbt(CompoundTag tag) Reads aPotionEffectfrom an NBT compound tag.org.bukkit.potion.PotionDataorg.bukkit.ColorgetColor()@NotNull List<org.bukkit.potion.PotionEffect>booleanhasColor()booleanhasCustomEffect(@NotNull org.bukkit.potion.PotionEffectType type) booleanbooleanisApplicable(org.bukkit.Material material) Check whether this ItemMeta can be applied to the given material.booleanremoveCustomEffect(@NotNull org.bukkit.potion.PotionEffectType type) voidsetBasePotionData(org.bukkit.potion.PotionData basePotionData) voidsetColor(org.bukkit.Color color) booleansetMainEffect(@NotNull org.bukkit.potion.PotionEffectType type) static CompoundTagtoNbt(org.bukkit.potion.PotionEffect effect) Converts aPotionEffectto 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, writeNbtEnchantsMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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, setVersionMethods 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,PotionDataandPotionEffects are copied; otherwise, the new potion has no effects.- Parameters:
meta- theItemMetato 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 aPotionEffectfrom an NBT compound tag.- Parameters:
tag- a potion effect NBT compound tag- Returns:
tagas aPotionEffect
-
toNbt
Converts aPotionEffectto an NBT compound tag.- Parameters:
effect- the potion effect- Returns:
effectas an NBT compound tag
-
isApplicable
public boolean isApplicable(org.bukkit.Material material) Description copied from class:GlowMetaItemCheck whether this ItemMeta can be applied to the given material.- Overrides:
isApplicablein classGlowMetaItem- Parameters:
material- The Material.- Returns:
- True if this ItemMeta is applicable.
-
clone
- Specified by:
clonein interfaceorg.bukkit.inventory.meta.ItemMeta- Specified by:
clonein interfaceorg.bukkit.inventory.meta.PotionMeta- Overrides:
clonein classGlowMetaItem
-
serialize
- Specified by:
serializein interfaceorg.bukkit.configuration.serialization.ConfigurationSerializable- Overrides:
serializein classGlowMetaItem
-
hasCustomEffects
public boolean hasCustomEffects()- Specified by:
hasCustomEffectsin interfaceorg.bukkit.inventory.meta.PotionMeta
-
getCustomEffects
- Specified by:
getCustomEffectsin interfaceorg.bukkit.inventory.meta.PotionMeta
-
addCustomEffect
public boolean addCustomEffect(@NotNull @NotNull org.bukkit.potion.PotionEffect effect, boolean overwrite) - Specified by:
addCustomEffectin interfaceorg.bukkit.inventory.meta.PotionMeta
-
removeCustomEffect
public boolean removeCustomEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type) - Specified by:
removeCustomEffectin interfaceorg.bukkit.inventory.meta.PotionMeta
-
hasCustomEffect
public boolean hasCustomEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type) - Specified by:
hasCustomEffectin interfaceorg.bukkit.inventory.meta.PotionMeta
-
setMainEffect
public boolean setMainEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type) - Specified by:
setMainEffectin interfaceorg.bukkit.inventory.meta.PotionMeta
-
clearCustomEffects
public boolean clearCustomEffects()- Specified by:
clearCustomEffectsin interfaceorg.bukkit.inventory.meta.PotionMeta
-
hasColor
public boolean hasColor()- Specified by:
hasColorin 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:
getBasePotionDatain interfaceorg.bukkit.inventory.meta.PotionMeta
-
setBasePotionData
public void setBasePotionData(org.bukkit.potion.PotionData basePotionData) - Specified by:
setBasePotionDatain interfaceorg.bukkit.inventory.meta.PotionMeta
-
getColor
public org.bukkit.Color getColor()- Specified by:
getColorin interfaceorg.bukkit.inventory.meta.PotionMeta
-
setColor
public void setColor(org.bukkit.Color color) - Specified by:
setColorin interfaceorg.bukkit.inventory.meta.PotionMeta
-