Interface ItemManager

All Known Implementing Classes:
ItemManagerImpl

public interface ItemManager
This class is used to manage custom items.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable CustomItem
    getCustomItem​(int customModelData)
    Gets a custom item from its custom model data.
    @Nullable CustomItem
    getCustomItem​(@NonNull String namespaceKey)
    Gets a custom item from its namespace key.
    @NonNull List<CustomItem>
    Gets a list of all registered custom items.
    @Nullable org.bukkit.inventory.ItemStack
    getItemStack​(int customModelData)
    Gets an item stack from a custom item's custom model data.
    @Nullable org.bukkit.inventory.ItemStack
    getItemStack​(@NonNull String namespaceKey)
    Gets an item stack from a custom item's namespace key.
    boolean
    isCustomHat​(@NonNull org.bukkit.inventory.ItemStack item)
    Gets if an item stack is a custom hat.
  • Method Details

    • getCustomItems

      @NonNull List<CustomItem> getCustomItems()
      Gets a list of all registered custom items.
      Returns:
      a list of all registered custom items
    • getCustomItem

      @Nullable CustomItem getCustomItem(@NonNull String namespaceKey)
      Gets a custom item from its namespace key.
      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

      @Nullable CustomItem getCustomItem(int customModelData)
      Gets a custom item from its custom model data.
      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

      @Nullable org.bukkit.inventory.ItemStack getItemStack(@NonNull String namespaceKey)
      Gets an item stack from a custom item's namespace key.
      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

      @Nullable org.bukkit.inventory.ItemStack getItemStack(int customModelData)
      Gets an item stack from a custom item's custom model data.
      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

      boolean isCustomHat(@NonNull org.bukkit.inventory.ItemStack item)
      Gets if an item stack is a custom hat.
      Parameters:
      item - the item stack to check
      Returns:
      true if the item stack is a custom hat, false otherwise