Class ItemMetaMock
java.lang.Object
be.seeseemelk.mockbukkit.inventory.meta.ItemMetaMock
- All Implemented Interfaces:
Cloneable,ConfigurationSerializable,Damageable,ItemMeta,Repairable,PersistentDataHolder
- Direct Known Subclasses:
ArmorStandMetaMock,AxolotlBucketMetaMock,BannerMetaMock,BookMetaMock,BundleMetaMock,CompassMetaMock,CrossbowMetaMock,EnchantedBookMetaMock,FireworkEffectMetaMock,FireworkMetaMock,KnowledgeBookMetaMock,LeatherArmorMetaMock,MapMetaMock,PotionMetaMock,SkullMetaMock,SpawnEggMetaMock,SuspiciousStewMetaMock,TropicalFishBucketMetaMock
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAttributeModifier(@NotNull Attribute attribute, @NotNull AttributeModifier modifier) booleanaddEnchant(@NotNull Enchantment ench, int level, boolean ignoreLevelRestriction) voidaddItemFlags(ItemFlag... itemFlags) voidassertComponentLore(@NotNull 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(@NotNull List<String> lines) Asserts if the lore contains the given lines in order.voidassertLore(String... lines) Asserts if the lore contains the given lines in order.@NotNull ItemMetaMockclone()static @NotNull ItemMetaMockdeserialize(@NotNull 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<Attribute,AttributeModifier> getAttributeModifiers(@NotNull Attribute attribute) @NotNull com.google.common.collect.Multimap<Attribute,AttributeModifier> getAttributeModifiers(@NotNull EquipmentSlot slot) int@NotNull CustomItemTagContainerint@NotNull Set<Namespaced>@NotNull String@NotNull net.md_5.bungee.api.chat.BaseComponent @NotNull []intgetEnchantLevel(Enchantment ench) @NotNull Map<Enchantment,Integer> @NotNull StringgetLore()@Nullable List<net.md_5.bungee.api.chat.BaseComponent[]>@NotNull PersistentDataContainer@NotNull Set<Namespaced>intbooleanbooleanbooleanbooleanbooleanbooleanbooleanhasEnchant(Enchantment ench) booleaninthashCode()booleanhasItemFlag(ItemFlag flag) booleanbooleanhasLore()booleanbooleanboolean@Nullable List<net.kyori.adventure.text.Component>lore()voidbooleanremoveAttributeModifier(@NotNull Attribute attribute) booleanremoveAttributeModifier(@NotNull Attribute attribute, @NotNull AttributeModifier modifier) booleanremoveAttributeModifier(@NotNull EquipmentSlot slot) booleanremoveEnchant(Enchantment ench) voidremoveItemFlags(ItemFlag... itemFlags) Serializes the properties of an ItemMetaMock to a HashMap.voidsetAttributeModifiers(@Nullable com.google.common.collect.Multimap<Attribute, AttributeModifier> attributeModifiers) voidsetCanDestroy(Set<Material> canDestroy) voidsetCanPlaceOn(Set<Material> canPlaceOn) voidsetCustomModelData(@Nullable Integer data) voidsetDamage(int damage) voidsetDestroyableKeys(@NotNull Collection<Namespaced> canDestroy) voidsetDisplayName(@Nullable String name) voidsetDisplayNameComponent(net.md_5.bungee.api.chat.BaseComponent @NotNull [] components) voidsetLocalizedName(@Nullable String name) voidvoidsetLoreComponents(@Nullable List<net.md_5.bungee.api.chat.BaseComponent[]> lore) voidsetPlaceableKeys(@NotNull Collection<Namespaced> canPlaceOn) voidsetRepairCost(int cost) voidsetUnbreakable(boolean unbreakable) voidsetVersion(int version)
-
Constructor Details
-
ItemMetaMock
public ItemMetaMock() -
ItemMetaMock
-
-
Method Details
-
hasDisplayName
public boolean hasDisplayName()- Specified by:
hasDisplayNamein interfaceItemMeta
-
displayName
@Nullable public @Nullable net.kyori.adventure.text.Component displayName()- Specified by:
displayNamein interfaceItemMeta
-
displayName
public void displayName(@Nullable @Nullable net.kyori.adventure.text.Component displayName) - Specified by:
displayNamein interfaceItemMeta
-
getDisplayName
- Specified by:
getDisplayNamein interfaceItemMeta
-
getDisplayNameComponent
@NotNull public @NotNull net.md_5.bungee.api.chat.BaseComponent @NotNull [] getDisplayNameComponent()- Specified by:
getDisplayNameComponentin interfaceItemMeta
-
setDisplayName
- Specified by:
setDisplayNamein interfaceItemMeta
-
setDisplayNameComponent
public void setDisplayNameComponent(net.md_5.bungee.api.chat.BaseComponent @NotNull [] components) - Specified by:
setDisplayNameComponentin interfaceItemMeta
-
hashCode
public int hashCode() -
equals
-
clone
- Specified by:
clonein interfaceDamageable- Specified by:
clonein interfaceItemMeta- Specified by:
clonein interfaceRepairable- Overrides:
clonein classObject
-
getCanDestroy
- Specified by:
getCanDestroyin interfaceItemMeta
-
setCanDestroy
- Specified by:
setCanDestroyin interfaceItemMeta
-
getCanPlaceOn
- Specified by:
getCanPlaceOnin interfaceItemMeta
-
setCanPlaceOn
- Specified by:
setCanPlaceOnin interfaceItemMeta
-
getDestroyableKeys
- Specified by:
getDestroyableKeysin interfaceItemMeta
-
setDestroyableKeys
- Specified by:
setDestroyableKeysin interfaceItemMeta
-
getPlaceableKeys
- Specified by:
getPlaceableKeysin interfaceItemMeta
-
setPlaceableKeys
- Specified by:
setPlaceableKeysin interfaceItemMeta
-
hasPlaceableKeys
public boolean hasPlaceableKeys()- Specified by:
hasPlaceableKeysin interfaceItemMeta
-
hasDestroyableKeys
public boolean hasDestroyableKeys()- Specified by:
hasDestroyableKeysin interfaceItemMeta
-
hasLore
public boolean hasLore() -
lore
-
lore
-
getLore
-
getLoreComponents
- Specified by:
getLoreComponentsin interfaceItemMeta
-
setLore
-
setLoreComponents
public void setLoreComponents(@Nullable @Nullable List<net.md_5.bungee.api.chat.BaseComponent[]> lore) - Specified by:
setLoreComponentsin interfaceItemMeta
-
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 interfaceConfigurationSerializable- 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 interfaceItemMeta
-
getLocalizedName
- Specified by:
getLocalizedNamein interfaceItemMeta
-
setLocalizedName
- Specified by:
setLocalizedNamein interfaceItemMeta
-
hasEnchants
public boolean hasEnchants()- Specified by:
hasEnchantsin interfaceItemMeta
-
hasEnchant
- Specified by:
hasEnchantin interfaceItemMeta
-
getEnchantLevel
- Specified by:
getEnchantLevelin interfaceItemMeta
-
getEnchants
- Specified by:
getEnchantsin interfaceItemMeta
-
addEnchant
public boolean addEnchant(@NotNull @NotNull Enchantment ench, int level, boolean ignoreLevelRestriction) - Specified by:
addEnchantin interfaceItemMeta
-
removeEnchant
- Specified by:
removeEnchantin interfaceItemMeta
-
hasConflictingEnchant
- Specified by:
hasConflictingEnchantin interfaceItemMeta
-
addItemFlags
- Specified by:
addItemFlagsin interfaceItemMeta
-
removeItemFlags
- Specified by:
removeItemFlagsin interfaceItemMeta
-
getItemFlags
- Specified by:
getItemFlagsin interfaceItemMeta
-
hasItemFlag
- Specified by:
hasItemFlagin interfaceItemMeta
-
isUnbreakable
public boolean isUnbreakable()- Specified by:
isUnbreakablein interfaceItemMeta
-
setUnbreakable
public void setUnbreakable(boolean unbreakable) - Specified by:
setUnbreakablein interfaceItemMeta
-
hasDamage
public boolean hasDamage()- Specified by:
hasDamagein interfaceDamageable
-
getDamage
public int getDamage()- Specified by:
getDamagein interfaceDamageable
-
setDamage
public void setDamage(int damage) - Specified by:
setDamagein interfaceDamageable
-
hasRepairCost
public boolean hasRepairCost()- Specified by:
hasRepairCostin interfaceRepairable
-
getRepairCost
public int getRepairCost()- Specified by:
getRepairCostin interfaceRepairable
-
setRepairCost
public void setRepairCost(int cost) - Specified by:
setRepairCostin interfaceRepairable
-
hasAttributeModifiers
public boolean hasAttributeModifiers()- Specified by:
hasAttributeModifiersin interfaceItemMeta
-
getAttributeModifiers
- Specified by:
getAttributeModifiersin interfaceItemMeta
-
setAttributeModifiers
public void setAttributeModifiers(@Nullable @Nullable com.google.common.collect.Multimap<Attribute, AttributeModifier> attributeModifiers) - Specified by:
setAttributeModifiersin interfaceItemMeta
-
getAttributeModifiers
@NotNull public @NotNull com.google.common.collect.Multimap<Attribute,AttributeModifier> getAttributeModifiers(@NotNull @NotNull EquipmentSlot slot) - Specified by:
getAttributeModifiersin interfaceItemMeta
-
getAttributeModifiers
- Specified by:
getAttributeModifiersin interfaceItemMeta
-
addAttributeModifier
public boolean addAttributeModifier(@NotNull @NotNull Attribute attribute, @NotNull @NotNull AttributeModifier modifier) - Specified by:
addAttributeModifierin interfaceItemMeta
-
removeAttributeModifier
- Specified by:
removeAttributeModifierin interfaceItemMeta
-
removeAttributeModifier
- Specified by:
removeAttributeModifierin interfaceItemMeta
-
removeAttributeModifier
public boolean removeAttributeModifier(@NotNull @NotNull Attribute attribute, @NotNull @NotNull AttributeModifier modifier) - Specified by:
removeAttributeModifierin interfaceItemMeta
-
getAsString
- Specified by:
getAsStringin interfaceItemMeta
-
getCustomTagContainer
- Specified by:
getCustomTagContainerin interfaceItemMeta
-
getPersistentDataContainer
- Specified by:
getPersistentDataContainerin interfacePersistentDataHolder
-
hasCustomModelData
public boolean hasCustomModelData()- Specified by:
hasCustomModelDatain interfaceItemMeta
-
getCustomModelData
public int getCustomModelData()- Specified by:
getCustomModelDatain interfaceItemMeta
-
setCustomModelData
- Specified by:
setCustomModelDatain interfaceItemMeta
-
setVersion
public void setVersion(int version) - Specified by:
setVersionin interfaceItemMeta
-