Class EnchantmentManagerImpl
java.lang.Object
com.github.imdabigboss.easydatapack.backend.managers.EnchantmentManagerImpl
- All Implemented Interfaces:
EnchantmentManager,org.bukkit.event.Listener
public class EnchantmentManagerImpl
extends Object
implements org.bukkit.event.Listener, EnchantmentManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull List<CustomEnchantment>Gets a list of all registered custom enchantments.voidonInventoryClickEvent(org.bukkit.event.inventory.InventoryClickEvent event)voidonInventoryDragEvent(org.bukkit.event.inventory.InventoryDragEvent event)voidonPrepareAnvilEvent(org.bukkit.event.inventory.PrepareAnvilEvent event)voidreformatItemNameColours(@NonNull org.bukkit.inventory.ItemStack result)This is used if an item is crafted with, or put into something like an anvil.voidregisterCustomEnchantment(CustomEnchantment enchantment)voidvoidvoidupdateItemLoreEnchants(@NonNull org.bukkit.inventory.ItemStack item)Update the item enchantment list lore.
-
Field Details
-
datapack
-
-
Constructor Details
-
EnchantmentManagerImpl
-
-
Method Details
-
registerCustomEnchantment
public void registerCustomEnchantment(CustomEnchantment enchantment) throws CustomEnchantmentException- Throws:
CustomEnchantmentException
-
unregisterEnchantments
public void unregisterEnchantments() -
registerEventListeners
public void registerEventListeners() -
reformatItemNameColours
public void reformatItemNameColours(@NonNull org.bukkit.inventory.ItemStack result)Description copied from interface:EnchantmentManagerThis is used if an item is crafted with, or put into something like an anvil. We are removing the colour codes from the raw name.- Specified by:
reformatItemNameColoursin interfaceEnchantmentManager- Parameters:
result- the result item that needs its name reformatting
-
getEnchantments
Description copied from interface:EnchantmentManagerGets a list of all registered custom enchantments.- Specified by:
getEnchantmentsin interfaceEnchantmentManager- Returns:
- a list of all registered custom enchantments
-
updateItemLoreEnchants
public void updateItemLoreEnchants(@NonNull org.bukkit.inventory.ItemStack item)Description copied from interface:EnchantmentManagerUpdate the item enchantment list lore. This exists because custom enchantments don't show up by default, so need to be added in manually to the lore.- Specified by:
updateItemLoreEnchantsin interfaceEnchantmentManager- Parameters:
item- the item to update the lore of
-
onPrepareAnvilEvent
public void onPrepareAnvilEvent(org.bukkit.event.inventory.PrepareAnvilEvent event) -
onInventoryDragEvent
public void onInventoryDragEvent(org.bukkit.event.inventory.InventoryDragEvent event) -
onInventoryClickEvent
public void onInventoryClickEvent(org.bukkit.event.inventory.InventoryClickEvent event)
-