Class PotionMetaMock

java.lang.Object
be.seeseemelk.mockbukkit.inventory.meta.ItemMetaMock
be.seeseemelk.mockbukkit.inventory.meta.PotionMetaMock
All Implemented Interfaces:
Cloneable, org.bukkit.configuration.serialization.ConfigurationSerializable, org.bukkit.inventory.meta.Damageable, org.bukkit.inventory.meta.ItemMeta, org.bukkit.inventory.meta.PotionMeta, org.bukkit.inventory.meta.Repairable, org.bukkit.persistence.PersistentDataHolder

public class PotionMetaMock extends ItemMetaMock implements org.bukkit.inventory.meta.PotionMeta
Mock implementation of a PotionMeta.
See Also:
  • Constructor Details

    • PotionMetaMock

      public PotionMetaMock()
      Constructs a new PotionMetaMock.
    • PotionMetaMock

      public PotionMetaMock(@NotNull @NotNull org.bukkit.inventory.meta.PotionMeta meta)
      Constructs a new PotionMetaMock, cloning the data from another.
      Parameters:
      meta - The meta to clone.
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ItemMetaMock
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class ItemMetaMock
    • clone

      @NotNull public @NotNull PotionMetaMock clone()
      Specified by:
      clone in interface org.bukkit.inventory.meta.Damageable
      Specified by:
      clone in interface org.bukkit.inventory.meta.ItemMeta
      Specified by:
      clone in interface org.bukkit.inventory.meta.PotionMeta
      Specified by:
      clone in interface org.bukkit.inventory.meta.Repairable
      Overrides:
      clone in class ItemMetaMock
    • addCustomEffect

      public boolean addCustomEffect(@NotNull @NotNull org.bukkit.potion.PotionEffect effect, boolean overwrite)
      Specified by:
      addCustomEffect in interface org.bukkit.inventory.meta.PotionMeta
    • clearCustomEffects

      public boolean clearCustomEffects()
      Specified by:
      clearCustomEffects in interface org.bukkit.inventory.meta.PotionMeta
    • getCustomEffects

      @NotNull public @NotNull List<org.bukkit.potion.PotionEffect> getCustomEffects()
      Specified by:
      getCustomEffects in interface org.bukkit.inventory.meta.PotionMeta
    • hasCustomEffect

      public boolean hasCustomEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type)
      Specified by:
      hasCustomEffect in interface org.bukkit.inventory.meta.PotionMeta
    • hasCustomEffects

      public boolean hasCustomEffects()
      Specified by:
      hasCustomEffects in interface org.bukkit.inventory.meta.PotionMeta
    • removeCustomEffect

      public boolean removeCustomEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type)
      Specified by:
      removeCustomEffect in interface org.bukkit.inventory.meta.PotionMeta
    • hasColor

      public boolean hasColor()
      Specified by:
      hasColor in interface org.bukkit.inventory.meta.PotionMeta
    • getColor

      @Nullable public @Nullable org.bukkit.Color getColor()
      Specified by:
      getColor in interface org.bukkit.inventory.meta.PotionMeta
    • setColor

      public void setColor(@Nullable @Nullable org.bukkit.Color color)
      Specified by:
      setColor in interface org.bukkit.inventory.meta.PotionMeta
    • setBasePotionData

      public void setBasePotionData(@Nullable @Nullable org.bukkit.potion.PotionData data)
      Specified by:
      setBasePotionData in interface org.bukkit.inventory.meta.PotionMeta
    • getBasePotionData

      @Nullable public @Nullable org.bukkit.potion.PotionData getBasePotionData()
      Specified by:
      getBasePotionData in interface org.bukkit.inventory.meta.PotionMeta
    • setBasePotionType

      public void setBasePotionType(@NotNull @NotNull org.bukkit.potion.PotionType type)
      Specified by:
      setBasePotionType in interface org.bukkit.inventory.meta.PotionMeta
    • getBasePotionType

      @NotNull public @NotNull org.bukkit.potion.PotionType getBasePotionType()
      Specified by:
      getBasePotionType in interface org.bukkit.inventory.meta.PotionMeta
    • hasBasePotionType

      public boolean hasBasePotionType()
      Specified by:
      hasBasePotionType in interface org.bukkit.inventory.meta.PotionMeta
    • setMainEffect

      @Deprecated(since="1.9") public boolean setMainEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type)
      Deprecated.
      Specified by:
      setMainEffect in interface org.bukkit.inventory.meta.PotionMeta
    • deserialize

      @NotNull public static @NotNull PotionMetaMock deserialize(@NotNull @NotNull Map<String,Object> args)
      Required method for Bukkit deserialization.
      Parameters:
      args - A serialized PotionMetaMock object in a Map<String, Object> format.
      Returns:
      A new instance of the PotionMetaMock class.
    • serialize

      @NotNull public @NotNull Map<String,Object> serialize()
      Serializes the properties of an PotionMetaMock to a HashMap. Unimplemented properties are not present in the map.
      Specified by:
      serialize in interface org.bukkit.configuration.serialization.ConfigurationSerializable
      Overrides:
      serialize in class ItemMetaMock
      Returns:
      A HashMap of String, Object pairs representing the PotionMetaMock.
    • getTypeName

      protected String getTypeName()
      Overrides:
      getTypeName in class ItemMetaMock