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
ConstructorsConstructorDescriptionEnchantmentType(org.bukkit.enchantments.Enchantment type)EnchantmentType(org.bukkit.enchantments.Enchantment type, int level) -
Method Summary
Modifier and TypeMethodDescriptionbooleanintintgetLevel()static Collection<String>getNames()@Nullable org.bukkit.enchantments.EnchantmentgetType()booleanDeprecated.inthashCode()static @Nullable EnchantmentTypeParses an enchantment type from string.static @Nullable org.bukkit.enchantments.EnchantmenttoString()static StringtoString(org.bukkit.enchantments.Enchantment e)static StringtoString(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 anEnchantmentand 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...)