Class EnchantmentMock
java.lang.Object
org.bukkit.enchantments.Enchantment
be.seeseemelk.mockbukkit.enchantments.EnchantmentMock
- All Implemented Interfaces:
net.kyori.adventure.key.Keyed,net.kyori.adventure.translation.Translatable,Keyed
Mock implementation of an
Enchantment.-
Field Summary
Fields inherited from class org.bukkit.enchantments.Enchantment
ARROW_DAMAGE, ARROW_FIRE, ARROW_INFINITE, ARROW_KNOCKBACK, BINDING_CURSE, CHANNELING, DAMAGE_ALL, DAMAGE_ARTHROPODS, DAMAGE_UNDEAD, DEPTH_STRIDER, DIG_SPEED, DURABILITY, FIRE_ASPECT, FROST_WALKER, IMPALING, KNOCKBACK, LOOT_BONUS_BLOCKS, LOOT_BONUS_MOBS, LOYALTY, LUCK, LURE, MENDING, MULTISHOT, OXYGEN, PIERCING, PROTECTION_ENVIRONMENTAL, PROTECTION_EXPLOSIONS, PROTECTION_FALL, PROTECTION_FIRE, PROTECTION_PROJECTILE, QUICK_CHARGE, RIPTIDE, SILK_TOUCH, SOUL_SPEED, SWEEPING_EDGE, SWIFT_SNEAK, THORNS, VANISHING_CURSE, WATER_WORKER -
Constructor Summary
ConstructorsConstructorDescriptionEnchantmentMock(@NotNull NamespacedKey key, @NotNull String name) Constructs a newEnchantmentMockwith the providedNamespacedKeyand name. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanEnchantItem(@NotNull ItemStack item) booleanconflictsWith(@NotNull Enchantment other) @NotNull net.kyori.adventure.text.ComponentdisplayName(int level) @NotNull Set<EquipmentSlot>floatgetDamageIncrease(int level, @NotNull EntityCategory entityCategory) @NotNull EnchantmentTargetint@NotNull StringgetName()@NotNull EnchantmentRarityintbooleanisCursed()booleanbooleanbooleanvoidsetCursed(boolean isCursed) Sets the return value ofisCursed().voidsetItemTarget(@NotNull EnchantmentTarget itemTarget) Sets the return value ofgetItemTarget().voidsetMaxLevel(int maxLevel) Sets the return value ofgetMaxLevel().voidsetStartLevel(int startLevel) Sets the return value ofgetStartLevel().voidsetTreasure(boolean isTreasure) Sets the return value ofisTreasure().@NotNull StringMethods inherited from class org.bukkit.enchantments.Enchantment
equals, getByKey, getByName, getKey, hashCode, isAcceptingRegistrations, registerEnchantment, stopAcceptingRegistrations, toString, values
-
Constructor Details
-
EnchantmentMock
Constructs a newEnchantmentMockwith the providedNamespacedKeyand name.- Parameters:
key- The key for the enchantment.name- The name of the enchantment.
-
-
Method Details
-
displayName
@NotNull public @NotNull net.kyori.adventure.text.Component displayName(int level) - Specified by:
displayNamein classEnchantment
-
isTradeable
public boolean isTradeable()- Specified by:
isTradeablein classEnchantment
-
isDiscoverable
public boolean isDiscoverable()- Specified by:
isDiscoverablein classEnchantment
-
getRarity
- Specified by:
getRarityin classEnchantment
-
getDamageIncrease
- Specified by:
getDamageIncreasein classEnchantment
-
getActiveSlots
- Specified by:
getActiveSlotsin classEnchantment
-
translationKey
-
getName
- Specified by:
getNamein classEnchantment
-
getMaxLevel
public int getMaxLevel()- Specified by:
getMaxLevelin classEnchantment
-
setMaxLevel
public void setMaxLevel(int maxLevel) Sets the return value ofgetMaxLevel().- Parameters:
maxLevel- The max level.- See Also:
-
getStartLevel
public int getStartLevel()- Specified by:
getStartLevelin classEnchantment
-
setStartLevel
public void setStartLevel(int startLevel) Sets the return value ofgetStartLevel().- Parameters:
startLevel- The start level.- See Also:
-
getItemTarget
- Specified by:
getItemTargetin classEnchantment
-
setItemTarget
Sets the return value ofgetItemTarget().- Parameters:
itemTarget- The item target.- See Also:
-
isTreasure
public boolean isTreasure()- Specified by:
isTreasurein classEnchantment
-
setTreasure
public void setTreasure(boolean isTreasure) Sets the return value ofisTreasure().- Parameters:
isTreasure- Whether the enchantment is treasure.- See Also:
-
isCursed
public boolean isCursed()- Specified by:
isCursedin classEnchantment
-
setCursed
public void setCursed(boolean isCursed) Sets the return value ofisCursed().- Parameters:
isCursed- Whether the enchantment is cursed.- See Also:
-
conflictsWith
- Specified by:
conflictsWithin classEnchantment
-
canEnchantItem
- Specified by:
canEnchantItemin classEnchantment
-