Class EnchantmentType

java.lang.Object
ch.njol.skript.util.EnchantmentType
All Implemented Interfaces:
YggdrasilSerializable

public class EnchantmentType extends Object implements YggdrasilSerializable
  • Constructor Details

    • EnchantmentType

      public EnchantmentType(org.bukkit.enchantments.Enchantment type)
    • EnchantmentType

      public EnchantmentType(org.bukkit.enchantments.Enchantment type, int level)
  • Method Details

    • getLevel

      public int getLevel()
      Returns:
      level or 1 if level == -1
    • getInternalLevel

      public int getInternalLevel()
      Returns:
      the internal level, can be -1
    • getType

      public @Nullable org.bukkit.enchantments.Enchantment getType()
    • has

      @Deprecated public boolean has(ItemType item)
      Checks whether the given item type has this enchantment.
      Parameters:
      item - the item to be checked.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public static String toString(org.bukkit.enchantments.Enchantment e)
    • toString

      public static String toString(org.bukkit.enchantments.Enchantment e, int flags)
    • parse

      public static @Nullable EnchantmentType parse(String s)
      Parses an enchantment type from string. This includes an Enchantment and its level.
      Parameters:
      s - String to parse.
      Returns:
      Enchantment type, or null if parsing failed.
    • parseEnchantment

      public static @Nullable org.bukkit.enchantments.Enchantment parseEnchantment(String s)
    • getNames

      public static Collection<String> getNames()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object