Class EnchantmentHelper
java.lang.Object
fr.andross.banitem.utils.enchantments.EnchantmentHelper
An enchantment helper class to retrieve correct Bukkit enchantments object across versions
- Version:
- 3.3.1
- Author:
- Andross
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<EnchantmentWrapper>
getAllEnchantmentWrappers
(org.bukkit.enchantments.Enchantment enchantment) Get all enchantmentwrappers (all levels) for a bukkit Enchantmentstatic org.bukkit.enchantments.Enchantment
getEnchantment
(String name) Try to get anEnchantment
object by the namestatic EnchantmentWrapper
getEnchantmentWrapper
(String enchant) Try to get anEnchantmentWrapper
from a string which synthax must be 'enchantment:level'
-
Constructor Details
-
EnchantmentHelper
public EnchantmentHelper()
-
-
Method Details
-
getEnchantment
Try to get anEnchantment
object by the name- Parameters:
name
- name of the enchantment- Returns:
- a bukkit enchantment object, null if not found
-
getEnchantmentWrapper
Try to get anEnchantmentWrapper
from a string which synthax must be 'enchantment:level'- Parameters:
enchant
- the string- Returns:
- an EnchantmentWrapper if valid, otherwise null
-
getAllEnchantmentWrappers
@NotNull public static List<EnchantmentWrapper> getAllEnchantmentWrappers(@NotNull org.bukkit.enchantments.Enchantment enchantment) Get all enchantmentwrappers (all levels) for a bukkit Enchantment- Parameters:
enchantment
- the bukkit enchantment- Returns:
- a list which contains all levels
-
getEnchantmentsNames
-