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
AQUA_AFFINITY, BANE_OF_ARTHROPODS, BINDING_CURSE, BLAST_PROTECTION, BREACH, CHANNELING, DENSITY, DEPTH_STRIDER, EFFICIENCY, FEATHER_FALLING, FIRE_ASPECT, FIRE_PROTECTION, FLAME, FORTUNE, FROST_WALKER, IMPALING, INFINITY, KNOCKBACK, LOOTING, LOYALTY, LUCK_OF_THE_SEA, LURE, MENDING, MULTISHOT, PIERCING, POWER, PROJECTILE_PROTECTION, PROTECTION, PUNCH, QUICK_CHARGE, RESPIRATION, RIPTIDE, SHARPNESS, SILK_TOUCH, SMITE, SOUL_SPEED, SWEEPING_EDGE, SWIFT_SNEAK, THORNS, UNBREAKING, VANISHING_CURSE, WIND_BURST -
Constructor Summary
ConstructorsConstructorDescriptionEnchantmentMock(com.google.gson.JsonObject data) Deprecated, for removal: This API element is subject to removal in a future version.EnchantmentMock(NamespacedKey namespacedKey, boolean treasure, boolean cursed, int maxLevel, int startLevel, String name, net.kyori.adventure.text.Component[] displayNames, int[] minModifiedCost, int[] maxModifiedCost, boolean tradeable, boolean discoverable, Set<NamespacedKey> conflicts, Set<NamespacedKey> enchantables, String translationKey, int anvilCost) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanEnchantItem(@NotNull ItemStack item) booleanconflictsWith(@NotNull Enchantment other) @NotNull net.kyori.adventure.text.Component@NotNull net.kyori.adventure.text.ComponentdisplayName(int level) static EnchantmentMockfrom(com.google.gson.JsonObject data) @NotNull Set<EquipmentSlotGroup> @NotNull Set<EquipmentSlot> Deprecated, for removal: This API element is subject to removal in a future version.intfloatgetDamageIncrease(int level, @NotNull EntityCategory entityCategory) Deprecated, for removal: This API element is subject to removal in a future version.floatgetDamageIncrease(int level, @NotNull EntityType entityType) Deprecated, for removal: This API element is subject to removal in a future version.@NotNull RegistryKeySet<Enchantment> @NotNull EnchantmentTargetDeprecated, for removal: This API element is subject to removal in a future version.@NotNull NamespacedKeygetKey()intintgetMaxModifiedCost(int level) intgetMinModifiedCost(int level) @NotNull StringgetName()@Nullable RegistryKeySet<ItemType> @NotNull EnchantmentRarityDeprecated, for removal: This API element is subject to removal in a future version.int@NotNull RegistryKeySet<ItemType> @NotNull StringDeprecated, for removal: This API element is subject to removal in a future version.intbooleanisCursed()booleanbooleanbooleanvoidsetCursed(boolean isCursed) Sets the return value ofisCursed().voidsetItemTarget(@NotNull EnchantmentTarget itemTarget) Deprecated, for removal: This API element is subject to removal in a future version.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 StringDeprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class org.bukkit.enchantments.Enchantment
getByKey, getByName, values
-
Constructor Details
-
EnchantmentMock
public EnchantmentMock(NamespacedKey namespacedKey, boolean treasure, boolean cursed, int maxLevel, int startLevel, String name, net.kyori.adventure.text.Component[] displayNames, int[] minModifiedCost, int[] maxModifiedCost, boolean tradeable, boolean discoverable, Set<NamespacedKey> conflicts, Set<NamespacedKey> enchantables, String translationKey, int anvilCost) - Parameters:
namespacedKey- The key representing 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 tableconflicts- Namespaced-keys of enchantments that are conflicting with this enchantmentenchantables- Namespaced-keys of items which can be enchanted by this enchantment
-
EnchantmentMock
@Deprecated(forRemoval=true, since="v3.82.0") public EnchantmentMock(com.google.gson.JsonObject data) 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
-
getAnvilCost
public int getAnvilCost()- Specified by:
getAnvilCostin classEnchantment
-
getMinModifiedCost
public int getMinModifiedCost(int level) - Specified by:
getMinModifiedCostin classEnchantment
-
getRarity
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getRarityin classEnchantment
-
getDamageIncrease
@Deprecated(forRemoval=true, since="1.20.5") public float getDamageIncrease(int level, @NotNull @NotNull EntityCategory entityCategory) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getDamageIncreasein classEnchantment
-
getDamageIncrease
@Deprecated(forRemoval=true, since="1.21") public float getDamageIncrease(int level, @NotNull @NotNull EntityType entityType) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getDamageIncreasein classEnchantment
-
getActiveSlots
@Deprecated(forRemoval=true, since="1.21") @NotNull public @NotNull Set<EquipmentSlot> getActiveSlots()Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
getActiveSlotsin classEnchantment
-
getActiveSlotGroups
- Specified by:
getActiveSlotGroupsin classEnchantment
-
description
@NotNull public @NotNull net.kyori.adventure.text.Component description()- Specified by:
descriptionin classEnchantment
-
getSupportedItems
- Specified by:
getSupportedItemsin classEnchantment
-
getPrimaryItems
- Specified by:
getPrimaryItemsin classEnchantment
-
getWeight
public int getWeight()- Specified by:
getWeightin classEnchantment
-
getExclusiveWith
- Specified by:
getExclusiveWithin classEnchantment
-
translationKey
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
translationKeyin interfacenet.kyori.adventure.translation.Translatable- Specified by:
translationKeyin classEnchantment
-
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
@Deprecated(forRemoval=true, since="1.20.5") @NotNull public @NotNull EnchantmentTarget getItemTarget()Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getItemTargetin classEnchantment
-
setItemTarget
@Deprecated(forRemoval=true) public void setItemTarget(@NotNull @NotNull EnchantmentTarget itemTarget) Deprecated, for removal: This API element is subject to removal in a future version.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
Deprecated, for removal: This API element is subject to removal in a future version. -
from
-
EnchantmentMock(NamespacedKey, boolean, boolean, int, int, String, Component[], int[], int[], boolean, boolean, Set, Set, String, int)instead.