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,Translatable
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(com.google.gson.JsonObject data) Deprecated, for removal: This API element is subject to removal in a future version.EnchantmentMock(NamespacedKey key, EnchantmentTarget target, boolean treasure, boolean cursed, int maxLevel, int startLevel, String name, net.kyori.adventure.text.Component[] displayNames, int[] minModifiedCost, int[] maxModifiedCost, boolean tradeable, boolean discoverable, EnchantmentRarity rarity, Set<NamespacedKey> conflicts) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanEnchantItem(@NotNull ItemStack item) booleanconflictsWith(@NotNull Enchantment other) @NotNull net.kyori.adventure.text.ComponentdisplayName(int level) static EnchantmentMockfrom(com.google.gson.JsonObject data) @NotNull Set<EquipmentSlot>floatgetDamageIncrease(int level, @NotNull EntityCategory entityCategory) @NotNull EnchantmentTarget@NotNull NamespacedKeygetKey()intintgetMaxModifiedCost(int level) intgetMinModifiedCost(int level) @NotNull StringgetName()@NotNull EnchantmentRarityint@NotNull StringbooleanisCursed()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
getByKey, getByName, values
-
Constructor Details
-
EnchantmentMock
public EnchantmentMock(NamespacedKey key, EnchantmentTarget target, boolean treasure, boolean cursed, int maxLevel, int startLevel, String name, net.kyori.adventure.text.Component[] displayNames, int[] minModifiedCost, int[] maxModifiedCost, boolean tradeable, boolean discoverable, EnchantmentRarity rarity, Set<NamespacedKey> conflicts) - Parameters:
key- The key representing this enchantmenttarget- the item targets of this enchantmenttreasure- Whether this enchantment can be found in a treasurecursed- Whether this enchantment is a cursemaxLevel- The max level of this enchantmentstartLevel- The min level of this enchantmentname- The name of the enchantmentdisplayNames- The display name of the enchantment dependent on levelminModifiedCost- The minimal modified cost for this enchantment dependent on levelmaxModifiedCost- The maximal modified cost for this enchantment dependent on leveltradeable- Whether this enchantment can be obtained from tradesdiscoverable- Whether this enchantment is in a loot tablerarity- The rarity of this enchantmentconflicts- Namespaced-keys of enchantments that are conflicting with this enchantment
-
EnchantmentMock
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
data- Json data
-
-
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
-
getMaxModifiedCost
public int getMaxModifiedCost(int level) - Specified by:
getMaxModifiedCostin classEnchantment
-
getMinModifiedCost
public int getMinModifiedCost(int level) - Specified by:
getMinModifiedCostin 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
-
getKey
-
getTranslationKey
-
from
-
EnchantmentMock(NamespacedKey, EnchantmentTarget, boolean, boolean, int, int, String, Component[], int[], int[], boolean, boolean, EnchantmentRarity, Set)instead.