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:
ArmorStandMetaMock,BannerMetaMock,BookMetaMock,BundleMetaMock,CompassMetaMock,CrossbowMetaMock,EnchantedBookMetaMock,FireworkEffectMetaMock,FireworkMetaMock,KnowledgeBookMetaMock,LeatherArmorMetaMock,MapMetaMock,PotionMetaMock,SkullMetaMock,SuspiciousStewMetaMock,TropicalFishBucketMetaMock
public class ItemMetaMock
extends Object
implements org.bukkit.inventory.meta.ItemMeta, org.bukkit.inventory.meta.Damageable, org.bukkit.inventory.meta.Repairable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAttributeModifier(@NotNull org.bukkit.attribute.Attribute attribute, @NotNull org.bukkit.attribute.AttributeModifier modifier) booleanaddEnchant(org.bukkit.enchantments.Enchantment ench, int level, boolean ignoreLevelRestriction) voidaddItemFlags(org.bukkit.inventory.ItemFlag... itemFlags) voidassertComponentLore(List<net.kyori.adventure.text.Component> lines) Asserts if the lore contains the given lines in order.voidAsserts that the item meta contains no lore.voidassertLore(String... lines) Asserts if the lore contains the given lines in order.voidassertLore(List<String> lines) Asserts if the lore contains the given lines in order.clone()static ItemMetaMockdeserialize(Map<String, Object> args) Required method for Bukkit deserialization.@Nullable net.kyori.adventure.text.ComponentvoiddisplayName(@Nullable net.kyori.adventure.text.Component displayName) boolean@NotNull Stringcom.google.common.collect.Multimap<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier> Collection<org.bukkit.attribute.AttributeModifier>getAttributeModifiers(@NotNull org.bukkit.attribute.Attribute attribute) @NotNull com.google.common.collect.Multimap<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier> getAttributeModifiers(@NotNull org.bukkit.inventory.EquipmentSlot slot) Set<org.bukkit.Material>Set<org.bukkit.Material>int@NotNull org.bukkit.inventory.meta.tags.CustomItemTagContainerint@NotNull Set<com.destroystokyo.paper.Namespaced>@NotNull net.md_5.bungee.api.chat.BaseComponent[]intgetEnchantLevel(org.bukkit.enchantments.Enchantment ench) Set<org.bukkit.inventory.ItemFlag>getLore()@Nullable List<net.md_5.bungee.api.chat.BaseComponent[]>@NotNull org.bukkit.persistence.PersistentDataContainer@NotNull Set<com.destroystokyo.paper.Namespaced>intbooleanbooleanhasConflictingEnchant(org.bukkit.enchantments.Enchantment ench) booleanbooleanbooleanbooleanbooleanhasEnchant(org.bukkit.enchantments.Enchantment ench) booleaninthashCode()booleanhasItemFlag(org.bukkit.inventory.ItemFlag flag) booleanbooleanhasLore()booleanbooleanboolean@Nullable List<net.kyori.adventure.text.Component>lore()voidbooleanremoveAttributeModifier(@NotNull org.bukkit.attribute.Attribute attribute) booleanremoveAttributeModifier(@NotNull org.bukkit.attribute.Attribute attribute, @NotNull org.bukkit.attribute.AttributeModifier modifier) booleanremoveAttributeModifier(@NotNull org.bukkit.inventory.EquipmentSlot slot) booleanremoveEnchant(org.bukkit.enchantments.Enchantment ench) voidremoveItemFlags(org.bukkit.inventory.ItemFlag... itemFlags) Serializes the properties of an ItemMetaMock to a HashMap.voidsetAttributeModifiers(com.google.common.collect.Multimap<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> attributeModifiers) voidsetCanDestroy(Set<org.bukkit.Material> canDestroy) voidsetCanPlaceOn(Set<org.bukkit.Material> canPlaceOn) voidsetCustomModelData(@Nullable Integer data) voidsetDamage(int damage) voidsetDestroyableKeys(@NotNull Collection<com.destroystokyo.paper.Namespaced> canDestroy) voidsetDisplayName(String name) voidsetDisplayNameComponent(@Nullable net.md_5.bungee.api.chat.BaseComponent[] components) voidsetLocalizedName(@Nullable String name) voidvoidsetLoreComponents(@Nullable List<net.md_5.bungee.api.chat.BaseComponent[]> lore) voidsetPlaceableKeys(@NotNull Collection<com.destroystokyo.paper.Namespaced> canPlaceOn) voidsetRepairCost(int cost) voidsetUnbreakable(boolean unbreakable) voidsetVersion(int version)
-
Constructor Details
-
ItemMetaMock
public ItemMetaMock() -
ItemMetaMock
public ItemMetaMock(@NotNull @NotNull org.bukkit.inventory.meta.ItemMeta meta)
-
-
Method Details
-
hasDisplayName
public boolean hasDisplayName()- Specified by:
hasDisplayNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
displayName
@Nullable public @Nullable net.kyori.adventure.text.Component displayName()- Specified by:
displayNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
displayName
public void displayName(@Nullable @Nullable net.kyori.adventure.text.Component displayName) - Specified by:
displayNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
getDisplayName
- Specified by:
getDisplayNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
getDisplayNameComponent
@NotNull public @NotNull net.md_5.bungee.api.chat.BaseComponent[] getDisplayNameComponent()- Specified by:
getDisplayNameComponentin interfaceorg.bukkit.inventory.meta.ItemMeta
-
setDisplayName
- Specified by:
setDisplayNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
setDisplayNameComponent
public void setDisplayNameComponent(@Nullable @Nullable net.md_5.bungee.api.chat.BaseComponent[] components) - Specified by:
setDisplayNameComponentin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hashCode
public int hashCode() -
equals
-
clone
-
getCanDestroy
- Specified by:
getCanDestroyin interfaceorg.bukkit.inventory.meta.ItemMeta
-
setCanDestroy
- Specified by:
setCanDestroyin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getCanPlaceOn
- Specified by:
getCanPlaceOnin interfaceorg.bukkit.inventory.meta.ItemMeta
-
setCanPlaceOn
- Specified by:
setCanPlaceOnin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getDestroyableKeys
- Specified by:
getDestroyableKeysin interfaceorg.bukkit.inventory.meta.ItemMeta
-
setDestroyableKeys
public void setDestroyableKeys(@NotNull @NotNull Collection<com.destroystokyo.paper.Namespaced> canDestroy) - Specified by:
setDestroyableKeysin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getPlaceableKeys
- Specified by:
getPlaceableKeysin interfaceorg.bukkit.inventory.meta.ItemMeta
-
setPlaceableKeys
public void setPlaceableKeys(@NotNull @NotNull Collection<com.destroystokyo.paper.Namespaced> canPlaceOn) - Specified by:
setPlaceableKeysin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasPlaceableKeys
public boolean hasPlaceableKeys()- Specified by:
hasPlaceableKeysin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasDestroyableKeys
public boolean hasDestroyableKeys()- Specified by:
hasDestroyableKeysin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasLore
public boolean hasLore()- Specified by:
hasLorein interfaceorg.bukkit.inventory.meta.ItemMeta
-
lore
- Specified by:
lorein interfaceorg.bukkit.inventory.meta.ItemMeta
-
lore
- Specified by:
lorein interfaceorg.bukkit.inventory.meta.ItemMeta
-
getLore
- Specified by:
getLorein interfaceorg.bukkit.inventory.meta.ItemMeta
-
getLoreComponents
- Specified by:
getLoreComponentsin interfaceorg.bukkit.inventory.meta.ItemMeta
-
setLore
- Specified by:
setLorein interfaceorg.bukkit.inventory.meta.ItemMeta
-
setLoreComponents
public void setLoreComponents(@Nullable @Nullable List<net.md_5.bungee.api.chat.BaseComponent[]> lore) - Specified by:
setLoreComponentsin interfaceorg.bukkit.inventory.meta.ItemMeta
-
assertLore
Asserts if the lore contains the given lines in order.- Parameters:
lines- The lines the lore should contain
-
assertComponentLore
Asserts if the lore contains the given lines in order.- Parameters:
lines- The lines the lore should contain
-
assertLore
Asserts if the lore contains the given lines in order.- Parameters:
lines- The lines the lore should contain
-
assertHasNoLore
Asserts that the item meta contains no lore.- Throws:
AssertionError- if the item meta contains some lore.
-
serialize
Serializes the properties of an ItemMetaMock to a HashMap. Unimplemented properties are not present in the map.- Specified by:
serializein interfaceorg.bukkit.configuration.serialization.ConfigurationSerializable- Returns:
- A HashMap of String, Object pairs representing the ItemMetaMock.
-
deserialize
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:
hasLocalizedNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
getLocalizedName
- Specified by:
getLocalizedNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
setLocalizedName
- Specified by:
setLocalizedNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasEnchants
public boolean hasEnchants()- Specified by:
hasEnchantsin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasEnchant
public boolean hasEnchant(org.bukkit.enchantments.Enchantment ench) - Specified by:
hasEnchantin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getEnchantLevel
public int getEnchantLevel(org.bukkit.enchantments.Enchantment ench) - Specified by:
getEnchantLevelin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getEnchants
- Specified by:
getEnchantsin interfaceorg.bukkit.inventory.meta.ItemMeta
-
addEnchant
public boolean addEnchant(org.bukkit.enchantments.Enchantment ench, int level, boolean ignoreLevelRestriction) - Specified by:
addEnchantin interfaceorg.bukkit.inventory.meta.ItemMeta
-
removeEnchant
public boolean removeEnchant(org.bukkit.enchantments.Enchantment ench) - Specified by:
removeEnchantin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasConflictingEnchant
public boolean hasConflictingEnchant(org.bukkit.enchantments.Enchantment ench) - Specified by:
hasConflictingEnchantin interfaceorg.bukkit.inventory.meta.ItemMeta
-
addItemFlags
public void addItemFlags(org.bukkit.inventory.ItemFlag... itemFlags) - Specified by:
addItemFlagsin interfaceorg.bukkit.inventory.meta.ItemMeta
-
removeItemFlags
public void removeItemFlags(org.bukkit.inventory.ItemFlag... itemFlags) - Specified by:
removeItemFlagsin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getItemFlags
- Specified by:
getItemFlagsin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasItemFlag
public boolean hasItemFlag(org.bukkit.inventory.ItemFlag flag) - Specified by:
hasItemFlagin interfaceorg.bukkit.inventory.meta.ItemMeta
-
isUnbreakable
public boolean isUnbreakable()- Specified by:
isUnbreakablein interfaceorg.bukkit.inventory.meta.ItemMeta
-
setUnbreakable
public void setUnbreakable(boolean unbreakable) - Specified by:
setUnbreakablein interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasDamage
public boolean hasDamage()- Specified by:
hasDamagein interfaceorg.bukkit.inventory.meta.Damageable
-
getDamage
public int getDamage()- Specified by:
getDamagein interfaceorg.bukkit.inventory.meta.Damageable
-
setDamage
public void setDamage(int damage) - Specified by:
setDamagein interfaceorg.bukkit.inventory.meta.Damageable
-
hasRepairCost
public boolean hasRepairCost()- Specified by:
hasRepairCostin interfaceorg.bukkit.inventory.meta.Repairable
-
getRepairCost
public int getRepairCost()- Specified by:
getRepairCostin interfaceorg.bukkit.inventory.meta.Repairable
-
setRepairCost
public void setRepairCost(int cost) - Specified by:
setRepairCostin interfaceorg.bukkit.inventory.meta.Repairable
-
hasAttributeModifiers
public boolean hasAttributeModifiers()- Specified by:
hasAttributeModifiersin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getAttributeModifiers
public com.google.common.collect.Multimap<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier> getAttributeModifiers()- Specified by:
getAttributeModifiersin interfaceorg.bukkit.inventory.meta.ItemMeta
-
setAttributeModifiers
public void setAttributeModifiers(com.google.common.collect.Multimap<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> attributeModifiers) - Specified by:
setAttributeModifiersin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getAttributeModifiers
@NotNull public @NotNull com.google.common.collect.Multimap<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier> getAttributeModifiers(@NotNull @NotNull org.bukkit.inventory.EquipmentSlot slot) - Specified by:
getAttributeModifiersin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getAttributeModifiers
public Collection<org.bukkit.attribute.AttributeModifier> getAttributeModifiers(@NotNull @NotNull org.bukkit.attribute.Attribute attribute) - Specified by:
getAttributeModifiersin interfaceorg.bukkit.inventory.meta.ItemMeta
-
addAttributeModifier
public boolean addAttributeModifier(@NotNull @NotNull org.bukkit.attribute.Attribute attribute, @NotNull @NotNull org.bukkit.attribute.AttributeModifier modifier) - Specified by:
addAttributeModifierin interfaceorg.bukkit.inventory.meta.ItemMeta
-
removeAttributeModifier
public boolean removeAttributeModifier(@NotNull @NotNull org.bukkit.attribute.Attribute attribute) - Specified by:
removeAttributeModifierin interfaceorg.bukkit.inventory.meta.ItemMeta
-
removeAttributeModifier
public boolean removeAttributeModifier(@NotNull @NotNull org.bukkit.inventory.EquipmentSlot slot) - Specified by:
removeAttributeModifierin interfaceorg.bukkit.inventory.meta.ItemMeta
-
removeAttributeModifier
public boolean removeAttributeModifier(@NotNull @NotNull org.bukkit.attribute.Attribute attribute, @NotNull @NotNull org.bukkit.attribute.AttributeModifier modifier) - Specified by:
removeAttributeModifierin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getAsString
- Specified by:
getAsStringin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getCustomTagContainer
@NotNull public @NotNull org.bukkit.inventory.meta.tags.CustomItemTagContainer getCustomTagContainer()- Specified by:
getCustomTagContainerin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getPersistentDataContainer
@NotNull public @NotNull org.bukkit.persistence.PersistentDataContainer getPersistentDataContainer()- Specified by:
getPersistentDataContainerin interfaceorg.bukkit.persistence.PersistentDataHolder
-
hasCustomModelData
public boolean hasCustomModelData()- Specified by:
hasCustomModelDatain interfaceorg.bukkit.inventory.meta.ItemMeta
-
getCustomModelData
public int getCustomModelData()- Specified by:
getCustomModelDatain interfaceorg.bukkit.inventory.meta.ItemMeta
-
setCustomModelData
- Specified by:
setCustomModelDatain interfaceorg.bukkit.inventory.meta.ItemMeta
-
setVersion
public void setVersion(int version) - Specified by:
setVersionin interfaceorg.bukkit.inventory.meta.ItemMeta
-