Class ItemMetaMock

java.lang.Object
be.seeseemelk.mockbukkit.inventory.meta.ItemMetaMock
All Implemented Interfaces:
Cloneable, org.bukkit.configuration.serialization.ConfigurationSerializable, org.bukkit.inventory.meta.Damageable, org.bukkit.inventory.meta.ItemMeta, org.bukkit.inventory.meta.Repairable, org.bukkit.persistence.PersistentDataHolder
Direct Known Subclasses:
BookMetaMock, EnchantedBookMetaMock, FireworkEffectMetaMock, FireworkMetaMock, KnowledgeBookMetaMock, LeatherArmorMetaMock, PotionMetaMock, SkullMetaMock, SuspiciousStewMetaMock

public class ItemMetaMock extends Object implements org.bukkit.inventory.meta.ItemMeta, org.bukkit.inventory.meta.Damageable, org.bukkit.inventory.meta.Repairable
  • Constructor Details

    • ItemMetaMock

      public ItemMetaMock()
    • ItemMetaMock

      public ItemMetaMock(@NotNull @NotNull org.bukkit.inventory.meta.ItemMeta meta)
  • Method Details

    • hasDisplayName

      public boolean hasDisplayName()
      Specified by:
      hasDisplayName in interface org.bukkit.inventory.meta.ItemMeta
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface org.bukkit.inventory.meta.ItemMeta
    • setDisplayName

      public void setDisplayName(String name)
      Specified by:
      setDisplayName in interface org.bukkit.inventory.meta.ItemMeta
    • hashCode

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

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

      public ItemMetaMock 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.Repairable
      Overrides:
      clone in class Object
    • hasLore

      public boolean hasLore()
      Specified by:
      hasLore in interface org.bukkit.inventory.meta.ItemMeta
    • getLore

      @Nullable public @Nullable List<String> getLore()
      Specified by:
      getLore in interface org.bukkit.inventory.meta.ItemMeta
    • setLore

      public void setLore(@Nullable @Nullable List<String> lore)
      Specified by:
      setLore in interface org.bukkit.inventory.meta.ItemMeta
    • assertLore

      public void assertLore(List<String> lines)
      Asserts if the lore contains the given lines in order.
      Parameters:
      lines - The lines the lore should contain
    • assertLore

      public void assertLore(String... lines)
      Asserts if the lore contains the given lines in order.
      Parameters:
      lines - The lines the lore should contain
    • assertHasNoLore

      public void assertHasNoLore() throws AssertionError
      Asserts that the item meta contains no lore.
      Throws:
      AssertionError - if the item meta contains some lore.
    • serialize

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

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

      public boolean hasLocalizedName()
      Specified by:
      hasLocalizedName in interface org.bukkit.inventory.meta.ItemMeta
    • getLocalizedName

      public String getLocalizedName()
      Specified by:
      getLocalizedName in interface org.bukkit.inventory.meta.ItemMeta
    • setLocalizedName

      public void setLocalizedName(@Nullable @Nullable String name)
      Specified by:
      setLocalizedName in interface org.bukkit.inventory.meta.ItemMeta
    • hasEnchants

      public boolean hasEnchants()
      Specified by:
      hasEnchants in interface org.bukkit.inventory.meta.ItemMeta
    • hasEnchant

      public boolean hasEnchant(org.bukkit.enchantments.Enchantment ench)
      Specified by:
      hasEnchant in interface org.bukkit.inventory.meta.ItemMeta
    • getEnchantLevel

      public int getEnchantLevel(org.bukkit.enchantments.Enchantment ench)
      Specified by:
      getEnchantLevel in interface org.bukkit.inventory.meta.ItemMeta
    • getEnchants

      public Map<org.bukkit.enchantments.Enchantment,Integer> getEnchants()
      Specified by:
      getEnchants in interface org.bukkit.inventory.meta.ItemMeta
    • addEnchant

      public boolean addEnchant(org.bukkit.enchantments.Enchantment ench, int level, boolean ignoreLevelRestriction)
      Specified by:
      addEnchant in interface org.bukkit.inventory.meta.ItemMeta
    • removeEnchant

      public boolean removeEnchant(org.bukkit.enchantments.Enchantment ench)
      Specified by:
      removeEnchant in interface org.bukkit.inventory.meta.ItemMeta
    • hasConflictingEnchant

      public boolean hasConflictingEnchant(org.bukkit.enchantments.Enchantment ench)
      Specified by:
      hasConflictingEnchant in interface org.bukkit.inventory.meta.ItemMeta
    • addItemFlags

      public void addItemFlags(org.bukkit.inventory.ItemFlag... itemFlags)
      Specified by:
      addItemFlags in interface org.bukkit.inventory.meta.ItemMeta
    • removeItemFlags

      public void removeItemFlags(org.bukkit.inventory.ItemFlag... itemFlags)
      Specified by:
      removeItemFlags in interface org.bukkit.inventory.meta.ItemMeta
    • getItemFlags

      public Set<org.bukkit.inventory.ItemFlag> getItemFlags()
      Specified by:
      getItemFlags in interface org.bukkit.inventory.meta.ItemMeta
    • hasItemFlag

      public boolean hasItemFlag(org.bukkit.inventory.ItemFlag flag)
      Specified by:
      hasItemFlag in interface org.bukkit.inventory.meta.ItemMeta
    • isUnbreakable

      public boolean isUnbreakable()
      Specified by:
      isUnbreakable in interface org.bukkit.inventory.meta.ItemMeta
    • setUnbreakable

      public void setUnbreakable(boolean unbreakable)
      Specified by:
      setUnbreakable in interface org.bukkit.inventory.meta.ItemMeta
    • hasDamage

      public boolean hasDamage()
      Specified by:
      hasDamage in interface org.bukkit.inventory.meta.Damageable
    • getDamage

      public int getDamage()
      Specified by:
      getDamage in interface org.bukkit.inventory.meta.Damageable
    • setDamage

      public void setDamage(int damage)
      Specified by:
      setDamage in interface org.bukkit.inventory.meta.Damageable
    • hasRepairCost

      public boolean hasRepairCost()
      Specified by:
      hasRepairCost in interface org.bukkit.inventory.meta.Repairable
    • getRepairCost

      public int getRepairCost()
      Specified by:
      getRepairCost in interface org.bukkit.inventory.meta.Repairable
    • setRepairCost

      public void setRepairCost(int cost)
      Specified by:
      setRepairCost in interface org.bukkit.inventory.meta.Repairable
    • hasAttributeModifiers

      public boolean hasAttributeModifiers()
      Specified by:
      hasAttributeModifiers in interface org.bukkit.inventory.meta.ItemMeta
    • getAttributeModifiers

      public com.google.common.collect.Multimap<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier> getAttributeModifiers()
      Specified by:
      getAttributeModifiers in interface org.bukkit.inventory.meta.ItemMeta
    • setAttributeModifiers

      public void setAttributeModifiers(com.google.common.collect.Multimap<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier> attributeModifiers)
      Specified by:
      setAttributeModifiers in interface org.bukkit.inventory.meta.ItemMeta
    • getAttributeModifiers

      public com.google.common.collect.Multimap<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier> getAttributeModifiers(org.bukkit.inventory.EquipmentSlot slot)
      Specified by:
      getAttributeModifiers in interface org.bukkit.inventory.meta.ItemMeta
    • getAttributeModifiers

      public Collection<org.bukkit.attribute.AttributeModifier> getAttributeModifiers(org.bukkit.attribute.Attribute attribute)
      Specified by:
      getAttributeModifiers in interface org.bukkit.inventory.meta.ItemMeta
    • addAttributeModifier

      public boolean addAttributeModifier(org.bukkit.attribute.Attribute attribute, org.bukkit.attribute.AttributeModifier modifier)
      Specified by:
      addAttributeModifier in interface org.bukkit.inventory.meta.ItemMeta
    • removeAttributeModifier

      public boolean removeAttributeModifier(org.bukkit.attribute.Attribute attribute)
      Specified by:
      removeAttributeModifier in interface org.bukkit.inventory.meta.ItemMeta
    • removeAttributeModifier

      public boolean removeAttributeModifier(org.bukkit.inventory.EquipmentSlot slot)
      Specified by:
      removeAttributeModifier in interface org.bukkit.inventory.meta.ItemMeta
    • removeAttributeModifier

      public boolean removeAttributeModifier(org.bukkit.attribute.Attribute attribute, org.bukkit.attribute.AttributeModifier modifier)
      Specified by:
      removeAttributeModifier in interface org.bukkit.inventory.meta.ItemMeta
    • getCustomTagContainer

      public org.bukkit.inventory.meta.tags.CustomItemTagContainer getCustomTagContainer()
      Specified by:
      getCustomTagContainer in interface org.bukkit.inventory.meta.ItemMeta
    • getPersistentDataContainer

      public org.bukkit.persistence.PersistentDataContainer getPersistentDataContainer()
      Specified by:
      getPersistentDataContainer in interface org.bukkit.persistence.PersistentDataHolder
    • hasCustomModelData

      public boolean hasCustomModelData()
      Specified by:
      hasCustomModelData in interface org.bukkit.inventory.meta.ItemMeta
    • getCustomModelData

      public int getCustomModelData()
      Specified by:
      getCustomModelData in interface org.bukkit.inventory.meta.ItemMeta
    • setCustomModelData

      public void setCustomModelData(@Nullable @Nullable Integer data)
      Specified by:
      setCustomModelData in interface org.bukkit.inventory.meta.ItemMeta
    • setVersion

      public void setVersion(int version)
      Specified by:
      setVersion in interface org.bukkit.inventory.meta.ItemMeta