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, org.bukkit.Keyed, org.bukkit.Translatable

public class EnchantmentMock extends org.bukkit.enchantments.Enchantment
Mock implementation of an Enchantment.
  • Constructor Details

    • EnchantmentMock

      public EnchantmentMock(org.bukkit.NamespacedKey key, org.bukkit.enchantments.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, io.papermc.paper.enchantments.EnchantmentRarity rarity, Set<org.bukkit.NamespacedKey> conflicts)
      Parameters:
      key - The key representing this enchantment
      target - the item targets of this enchantment
      treasure - Whether this enchantment can be found in a treasure
      cursed - Whether this enchantment is a curse
      maxLevel - The max level of this enchantment
      startLevel - The min level of this enchantment
      name - The name of the enchantment
      displayNames - The display name of the enchantment dependent on level
      minModifiedCost - The minimal modified cost for this enchantment dependent on level
      maxModifiedCost - The maximal modified cost for this enchantment dependent on level
      tradeable - Whether this enchantment can be obtained from trades
      discoverable - Whether this enchantment is in a loot table
      rarity - The rarity of this enchantment
      conflicts - Namespaced-keys of enchantments that are conflicting with this enchantment
    • EnchantmentMock

      @Deprecated(forRemoval=true) public EnchantmentMock(com.google.gson.JsonObject data)
      Parameters:
      data - Json data
  • Method Details

    • displayName

      @NotNull public @NotNull net.kyori.adventure.text.Component displayName(int level)
      Specified by:
      displayName in class org.bukkit.enchantments.Enchantment
    • isTradeable

      public boolean isTradeable()
      Specified by:
      isTradeable in class org.bukkit.enchantments.Enchantment
    • isDiscoverable

      public boolean isDiscoverable()
      Specified by:
      isDiscoverable in class org.bukkit.enchantments.Enchantment
    • getMaxModifiedCost

      public int getMaxModifiedCost(int level)
      Specified by:
      getMaxModifiedCost in class org.bukkit.enchantments.Enchantment
    • getMinModifiedCost

      public int getMinModifiedCost(int level)
      Specified by:
      getMinModifiedCost in class org.bukkit.enchantments.Enchantment
    • getRarity

      @NotNull public @NotNull io.papermc.paper.enchantments.EnchantmentRarity getRarity()
      Specified by:
      getRarity in class org.bukkit.enchantments.Enchantment
    • getDamageIncrease

      public float getDamageIncrease(int level, @NotNull @NotNull org.bukkit.entity.EntityCategory entityCategory)
      Specified by:
      getDamageIncrease in class org.bukkit.enchantments.Enchantment
    • getActiveSlots

      @NotNull public @NotNull Set<org.bukkit.inventory.EquipmentSlot> getActiveSlots()
      Specified by:
      getActiveSlots in class org.bukkit.enchantments.Enchantment
    • translationKey

      @NotNull public @NotNull String translationKey()
    • getName

      @NotNull public @NotNull String getName()
      Specified by:
      getName in class org.bukkit.enchantments.Enchantment
    • getMaxLevel

      public int getMaxLevel()
      Specified by:
      getMaxLevel in class org.bukkit.enchantments.Enchantment
    • setMaxLevel

      public void setMaxLevel(int maxLevel)
      Sets the return value of getMaxLevel().
      Parameters:
      maxLevel - The max level.
      See Also:
    • getStartLevel

      public int getStartLevel()
      Specified by:
      getStartLevel in class org.bukkit.enchantments.Enchantment
    • setStartLevel

      public void setStartLevel(int startLevel)
      Sets the return value of getStartLevel().
      Parameters:
      startLevel - The start level.
      See Also:
    • getItemTarget

      @NotNull public @NotNull org.bukkit.enchantments.EnchantmentTarget getItemTarget()
      Specified by:
      getItemTarget in class org.bukkit.enchantments.Enchantment
    • setItemTarget

      public void setItemTarget(@NotNull @NotNull org.bukkit.enchantments.EnchantmentTarget itemTarget)
      Sets the return value of getItemTarget().
      Parameters:
      itemTarget - The item target.
      See Also:
    • isTreasure

      public boolean isTreasure()
      Specified by:
      isTreasure in class org.bukkit.enchantments.Enchantment
    • setTreasure

      public void setTreasure(boolean isTreasure)
      Sets the return value of isTreasure().
      Parameters:
      isTreasure - Whether the enchantment is treasure.
      See Also:
    • isCursed

      public boolean isCursed()
      Specified by:
      isCursed in class org.bukkit.enchantments.Enchantment
    • setCursed

      public void setCursed(boolean isCursed)
      Sets the return value of isCursed().
      Parameters:
      isCursed - Whether the enchantment is cursed.
      See Also:
    • conflictsWith

      public boolean conflictsWith(@NotNull @NotNull org.bukkit.enchantments.Enchantment other)
      Specified by:
      conflictsWith in class org.bukkit.enchantments.Enchantment
    • canEnchantItem

      public boolean canEnchantItem(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Specified by:
      canEnchantItem in class org.bukkit.enchantments.Enchantment
    • getKey

      @NotNull public @NotNull org.bukkit.NamespacedKey getKey()
    • getTranslationKey

      @NotNull public @NotNull String getTranslationKey()
    • from

      @Internal public static EnchantmentMock from(com.google.gson.JsonObject data)