Package ch.njol.skript.util
Class EnchantmentType
java.lang.Object
ch.njol.skript.util.EnchantmentType
- All Implemented Interfaces:
YggdrasilSerializable
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.njol.yggdrasil.YggdrasilSerializable
YggdrasilSerializable.YggdrasilExtendedSerializable, YggdrasilSerializable.YggdrasilRobustEnum, YggdrasilSerializable.YggdrasilRobustSerializable
-
Constructor Summary
ConstructorDescriptionEnchantmentType(org.bukkit.enchantments.Enchantment type)
EnchantmentType(org.bukkit.enchantments.Enchantment type, int level)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
int
getLevel()
static Collection<String>
getNames()
@Nullable org.bukkit.enchantments.Enchantment
getType()
boolean
Deprecated.int
hashCode()
static @Nullable EnchantmentType
Parses an enchantment type from string.static @Nullable org.bukkit.enchantments.Enchantment
toString()
static String
toString(org.bukkit.enchantments.Enchantment e)
static String
toString(org.bukkit.enchantments.Enchantment e, int flags)
-
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.Checks whether the given item type has this enchantment.- Parameters:
item
- the item to be checked.
-
toString
-
toString
-
toString
-
parse
Parses an enchantment type from string. This includes anEnchantment
and its level.- Parameters:
s
- String to parse.- Returns:
- Enchantment type, or null if parsing failed.
-
parseEnchantment
-
getNames
-
hashCode
public int hashCode() -
equals
-
ItemType.hasEnchantments(Enchantment...)