Class ItemMetaMock
java.lang.Object
be.seeseemelk.mockbukkit.inventory.meta.ItemMetaMock
- All Implemented Interfaces:
PersistentDataViewHolder,Cloneable,ConfigurationSerializable,Damageable,ItemMeta,Repairable,PersistentDataHolder
- Direct Known Subclasses:
ArmorMetaMock,ArmorStandMetaMock,AxolotlBucketMetaMock,BannerMetaMock,BookMetaMock,BundleMetaMock,CompassMetaMock,CrossbowMetaMock,EnchantedBookMetaMock,FireworkEffectMetaMock,FireworkMetaMock,KnowledgeBookMetaMock,LeatherArmorMetaMock,MapMetaMock,OminousBottleMetaMock,PotionMetaMock,SkullMetaMock,SpawnEggMetaMock,SuspiciousStewMetaMock,TropicalFishBucketMetaMock
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newItemMetaMock.ItemMetaMock(@NotNull ItemMeta meta) Constructs a newItemMetaMock, cloning the data from another. -
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(String... lines) Asserts if the lore contains the given lines in order.voidassertLore(@NotNull List<String> lines) Asserts if the lore contains the given lines in order.clone()static @NotNull ItemMetaMockdeserialize(@NotNull Map<String, Object> args) Required method for Bukkit deserialization.protected voiddeserializeInternal(@NotNull Map<String, Object> args) @Nullable net.kyori.adventure.text.ComponentvoiddisplayName(@Nullable net.kyori.adventure.text.Component displayName) boolean@NotNull String@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 Boolean@NotNull Map<Enchantment, Integer> @NotNull FoodComponentgetFood()@NotNull StringDeprecated.@NotNull JukeboxPlayableComponent@NotNull StringDeprecated, for removal: This API element is subject to removal in a future version.getLore()@Nullable List<net.md_5.bungee.api.chat.BaseComponent[]> intint@NotNull PersistentDataContainer@NotNull Set<Namespaced> @NotNull ItemRarityint@NotNull ToolComponentgetTool()protected StringbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanhasEnchant(Enchantment ench) booleanbooleanbooleanhasFood()inthashCode()booleanhasItemFlag(ItemFlag flag) booleanbooleanbooleanDeprecated, for removal: This API element is subject to removal in a future version.booleanhasLore()booleanbooleanbooleanbooleanbooleanbooleanhasTool()booleanbooleanboolean@NotNull net.kyori.adventure.text.ComponentitemName()voiditemName(@Nullable net.kyori.adventure.text.Component name) @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) voidvoidremoveItemFlags(ItemFlag... itemFlags) voidSerializes the properties of an ItemMetaMock to a HashMap.voidsetAttributeModifiers(@Nullable com.google.common.collect.Multimap<Attribute, AttributeModifier> attributeModifiers) voidsetCanDestroy(Set<Material> set) voidsetCanPlaceOn(Set<Material> set) voidsetCustomModelData(@Nullable Integer data) voidsetDamage(int damage) voidsetDestroyableKeys(@NotNull Collection<Namespaced> collection) voidsetDisplayName(@Nullable String name) voidsetDisplayNameComponent(net.md_5.bungee.api.chat.BaseComponent @NotNull [] components) voidsetEnchantmentGlintOverride(@Nullable Boolean override) voidsetFireResistant(boolean fireResistant) voidsetFood(@Nullable FoodComponent food) voidsetHideTooltip(boolean hideTooltip) voidsetItemName(@Nullable String name) Deprecated.voidsetJukeboxPlayable(@Nullable JukeboxPlayableComponent jukeboxPlayable) voidsetLocalizedName(@Nullable String name) Deprecated, for removal: This API element is subject to removal in a future version.voidvoidsetLoreComponents(@Nullable List<net.md_5.bungee.api.chat.BaseComponent[]> lore) voidsetMaxDamage(@Nullable Integer maxDamage) voidsetMaxStackSize(@Nullable Integer max) voidsetPlaceableKeys(@NotNull Collection<Namespaced> collection) voidsetRarity(@Nullable ItemRarity rarity) voidsetRepairCost(int cost) voidsetTool(@Nullable ToolComponent toolComponent) voidsetUnbreakable(boolean unbreakable) voidsetVersion(int version) toString()
-
Constructor Details
-
ItemMetaMock
public ItemMetaMock()Constructs a newItemMetaMock. -
ItemMetaMock
Constructs a newItemMetaMock, cloning the data from another.- Parameters:
meta- The meta to clone.
-
-
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.
-
deserializeInternal
-
hasLocalizedName
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
hasLocalizedNamein interfaceItemMeta
-
getLocalizedName
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getLocalizedNamein interfaceItemMeta
-
setLocalizedName
@Deprecated(forRemoval=true, since="1.20.6") public void setLocalizedName(@Nullable @Nullable String name) Deprecated, for removal: This API element is subject to removal in a future version.- 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
-
removeEnchantments
public void removeEnchantments()- Specified by:
removeEnchantmentsin 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
-
hasDamageValue
public boolean hasDamageValue()- Specified by:
hasDamageValuein interfaceDamageable
-
resetDamage
public void resetDamage()- Specified by:
resetDamagein 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
-
getAsComponentString
- Specified by:
getAsComponentStringin interfaceItemMeta
-
getCustomTagContainer
- Specified by:
getCustomTagContainerin interfaceItemMeta
-
getPersistentDataContainer
- Specified by:
getPersistentDataContainerin interfacePersistentDataHolder- Specified by:
getPersistentDataContainerin interfacePersistentDataViewHolder
-
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
-
hasMaxDamage
public boolean hasMaxDamage()- Specified by:
hasMaxDamagein interfaceDamageable
-
getMaxDamage
public int getMaxDamage()- Specified by:
getMaxDamagein interfaceDamageable
-
setMaxDamage
- Specified by:
setMaxDamagein interfaceDamageable
-
hasItemName
public boolean hasItemName()- Specified by:
hasItemNamein interfaceItemMeta
-
itemName
@NotNull public @NotNull net.kyori.adventure.text.Component itemName() -
itemName
public void itemName(@Nullable @Nullable net.kyori.adventure.text.Component name) -
getItemName
Deprecated.- Specified by:
getItemNamein interfaceItemMeta
-
setItemName
Deprecated.- Specified by:
setItemNamein interfaceItemMeta
-
isHideTooltip
public boolean isHideTooltip()- Specified by:
isHideTooltipin interfaceItemMeta
-
setHideTooltip
public void setHideTooltip(boolean hideTooltip) - Specified by:
setHideTooltipin interfaceItemMeta
-
hasEnchantmentGlintOverride
public boolean hasEnchantmentGlintOverride()- Specified by:
hasEnchantmentGlintOverridein interfaceItemMeta
-
getEnchantmentGlintOverride
- Specified by:
getEnchantmentGlintOverridein interfaceItemMeta
-
setEnchantmentGlintOverride
- Specified by:
setEnchantmentGlintOverridein interfaceItemMeta
-
isFireResistant
public boolean isFireResistant()- Specified by:
isFireResistantin interfaceItemMeta
-
setFireResistant
public void setFireResistant(boolean fireResistant) - Specified by:
setFireResistantin interfaceItemMeta
-
hasMaxStackSize
public boolean hasMaxStackSize()- Specified by:
hasMaxStackSizein interfaceItemMeta
-
getMaxStackSize
public int getMaxStackSize()- Specified by:
getMaxStackSizein interfaceItemMeta
-
setMaxStackSize
- Specified by:
setMaxStackSizein interfaceItemMeta
-
hasRarity
public boolean hasRarity() -
getRarity
-
setRarity
-
hasFood
public boolean hasFood() -
getFood
-
getTypeName
-
setFood
-
hasTool
public boolean hasTool() -
getTool
-
setTool
-
hasJukeboxPlayable
public boolean hasJukeboxPlayable()- Specified by:
hasJukeboxPlayablein interfaceItemMeta
-
getJukeboxPlayable
- Specified by:
getJukeboxPlayablein interfaceItemMeta
-
setJukeboxPlayable
- Specified by:
setJukeboxPlayablein interfaceItemMeta
-
toString
-