Class EnchantmentUtil
- java.lang.Object
-
- me.boboballoon.enhancedenchantments.manager.EnchantmentUtil
-
public class EnchantmentUtil extends Object
A class that has util methods to help retrieve enchantments from itemstacks
-
-
Constructor Summary
Constructors Constructor Description EnchantmentUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static EnchantedBook
getEnchantedBook(ItemStack item)
Returns an enchanted book object based on an itemstackstatic EnchantmentHolder
getEnchantmentHolder(ItemStack item)
Used to get enchantments off of an itemstatic boolean
isEnchanted(ItemStack item)
Check if an item is enchantedstatic boolean
isEnchantedBook(ItemStack item)
Check if an item is an enchanted book
-
-
-
Method Detail
-
isEnchanted
public static boolean isEnchanted(ItemStack item)
Check if an item is enchanted- Parameters:
item
- the item which you wish to check- Returns:
- true if the item does have an enchantment otherwise false
-
isEnchantedBook
public static boolean isEnchantedBook(ItemStack item)
Check if an item is an enchanted book- Parameters:
item
- the item which you wish to check- Returns:
- true if the item is an enchanted book otherwise false
-
getEnchantmentHolder
public static EnchantmentHolder getEnchantmentHolder(ItemStack item)
Used to get enchantments off of an item- Parameters:
item
- the item which you wish to check- Returns:
- the enchantment holder, will create a new one if nothing is present
-
getEnchantedBook
public static EnchantedBook getEnchantedBook(ItemStack item)
Returns an enchanted book object based on an itemstack- Parameters:
item
- the enchanted book itemstack- Returns:
- an enchanted book object based on said itemstack, null if itemstack is not an enchanted book
-
-