Class EnchantmentWrapper
java.lang.Object
fr.andross.banitem.utils.enchantments.EnchantmentWrapper
An enchantment wrapper class that stores the Bukkit enchantment with a level.
- Version:
- 3.1
- Author:
- Andross
-
Constructor Summary
ConstructorsConstructorDescriptionEnchantmentWrapper
(@NotNull org.bukkit.enchantments.Enchantment enchantment, int level) Wrap a minecraft enchantment with its level, so it can easily be compared depending on the Minecraft version used. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static @NotNull Set
<EnchantmentWrapper> Create a set of this wrapper from a map of enchantments.@NotNull org.bukkit.enchantments.Enchantment
Get the Minecraft enchantment.int
getLevel()
Get the level of the enchantment.int
hashCode()
-
Constructor Details
-
EnchantmentWrapper
public EnchantmentWrapper(@NotNull @NotNull org.bukkit.enchantments.Enchantment enchantment, int level) Wrap a minecraft enchantment with its level, so it can easily be compared depending on the Minecraft version used.- Parameters:
enchantment
- the Minecraft enchantmentlevel
- the enchantment level
-
-
Method Details
-
getEnchantment
@NotNull public @NotNull org.bukkit.enchantments.Enchantment getEnchantment()Get the Minecraft enchantment.- Returns:
- the Minecraft enchantment
-
getLevel
public int getLevel()Get the level of the enchantment.- Returns:
- the level of the enchantment
-
from
@NotNull public static @NotNull Set<EnchantmentWrapper> from(@NotNull @NotNull Map<org.bukkit.enchantments.Enchantment, Integer> map) Create a set of this wrapper from a map of enchantments.- Parameters:
map
- map of enchantments- Returns:
- set of this wrapper from the map
-
equals
-
hashCode
public int hashCode()
-