Class EnchantmentWrapper

java.lang.Object
fr.andross.banitem.utils.enchantments.EnchantmentWrapper

public final class EnchantmentWrapper extends Object
An enchantment wrapper class that stores the Bukkit enchantment with a level
Version:
3.1
Author:
Andross
  • Constructor Details

    • EnchantmentWrapper

      public EnchantmentWrapper(@NotNull org.bukkit.enchantments.Enchantment enchantment, int level)
  • Method Details

    • getEnchantment

      @NotNull public org.bukkit.enchantments.Enchantment getEnchantment()
      Get the Bukkit enchantment
      Returns:
      the bukkit enchantment
    • getLevel

      public int getLevel()
      Get the level of the enchantment
      Returns:
      the level of the enchantment
    • from

      @NotNull public static Set<EnchantmentWrapper> from(@NotNull Map<org.bukkit.enchantments.Enchantment,Integer> map)
      Create a set of this wrapper from a map of enchantements
      Parameters:
      map - map of enchantments
      Returns:
      set of this wrapper from the map
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object