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()
@Nullable org.bukkit.enchantments.Enchantment
getType()
boolean
Deprecated.int
hashCode()
static @Nullable EnchantmentType
Parses an enchantment type from string.toString()
-
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.Checks whether the given item type has this enchantment.- Parameters:
item
- the item to be checked.
-
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.
-
hashCode
public int hashCode() -
equals
-
ItemType.hasEnchantments(Enchantment...)