java.lang.Object
com.github.imdabigboss.easydatapack.backend.managers.ItemManagerImpl
All Implemented Interfaces:
ItemManager, org.bukkit.event.Listener

public class ItemManagerImpl extends Object implements org.bukkit.event.Listener, ItemManager
  • Constructor Details

    • ItemManagerImpl

      public ItemManagerImpl(EasyDatapack datapack)
  • Method Details

    • registerCustomItem

      public void registerCustomItem(CustomItem item) throws EasyDatapackException
      Throws:
      EasyDatapackException
    • registerEventListeners

      public void registerEventListeners()
    • getCustomItems

      public @NonNull List<CustomItem> getCustomItems()
      Description copied from interface: ItemManager
      Gets a list of all registered custom items.
      Specified by:
      getCustomItems in interface ItemManager
      Returns:
      a list of all registered custom items
    • getCustomItem

      public CustomItem getCustomItem(@NonNull String namespaceKey)
      Description copied from interface: ItemManager
      Gets a custom item from its namespace key.
      Specified by:
      getCustomItem in interface ItemManager
      Parameters:
      namespaceKey - the namespace key of the custom item
      Returns:
      the custom item with the given namespace key. Will be null if there is nothing associated with the namespace key.
    • getCustomItem

      public CustomItem getCustomItem(int customModelData)
      Description copied from interface: ItemManager
      Gets a custom item from its custom model data.
      Specified by:
      getCustomItem in interface ItemManager
      Parameters:
      customModelData - the item's custom model data
      Returns:
      the custom item with the given custom model data. Will be null if there is nothing associated with the custom model data.
    • getItemStack

      public org.bukkit.inventory.ItemStack getItemStack(@NonNull String namespaceKey)
      Description copied from interface: ItemManager
      Gets an item stack from a custom item's namespace key.
      Specified by:
      getItemStack in interface ItemManager
      Parameters:
      namespaceKey - the namespace key of the custom item
      Returns:
      the custom item's item stack with the given namespace key. Will be null if there is nothing associated with the namespace key.
    • getItemStack

      public org.bukkit.inventory.ItemStack getItemStack(int customModelData)
      Description copied from interface: ItemManager
      Gets an item stack from a custom item's custom model data.
      Specified by:
      getItemStack in interface ItemManager
      Parameters:
      customModelData - the item's custom model data
      Returns:
      the custom item's item stack with the given custom model data. Will be null if there is nothing associated with the custom model data.
    • isCustomHat

      public boolean isCustomHat(@NonNull org.bukkit.inventory.ItemStack item)
      Description copied from interface: ItemManager
      Gets if an item stack is a custom hat.
      Specified by:
      isCustomHat in interface ItemManager
      Parameters:
      item - the item stack to check
      Returns:
      true if the item stack is a custom hat, false otherwise
    • onPrepareSmithingEvent

      public void onPrepareSmithingEvent(org.bukkit.event.inventory.PrepareSmithingEvent event)
    • onInventoryCreativeEvent

      public void onInventoryCreativeEvent(org.bukkit.event.inventory.InventoryCreativeEvent event)
    • onInventoryClickEvent

      public void onInventoryClickEvent(org.bukkit.event.inventory.InventoryClickEvent event)
    • playerInteractEvent

      public void playerInteractEvent(org.bukkit.event.player.PlayerInteractEvent event)
    • entityDamageByEntityEvent

      public void entityDamageByEntityEvent(org.bukkit.event.entity.EntityDamageByEntityEvent event)
    • onBlockBreak

      public void onBlockBreak(org.bukkit.event.block.BlockBreakEvent event)