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

      @Nullable 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
    • parse

      @Nullable 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.
    • hashCode

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

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