Interface IItemDb

All Known Subinterfaces:
IItemDb
All Known Implementing Classes:
AbstractItemDb, FlatItemDb, LegacyItemDb

@Deprecated public interface IItemDb
Deprecated.
External plugins should use IItemDb instead, which includes access to IItemDb.ItemResolver APIs.
Provides access to the current item alias registry.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(String name)
    Deprecated.
    Create a stack from the given name with the maximum stack size for that material.
    default ItemStack
    get(String name, int quantity)
    Deprecated.
    Create a stack from the given name with the given quantity.
    default Material
    getFromLegacy(int id, byte damage)
    Deprecated.
    Convert legacy ID and damage value to Material.
    default Material
    Deprecated.
    Convert colon syntax (eg.
    default Material
    Deprecated.
    int
    Deprecated.
    Item IDs are no longer supported.
    getMatching(User user, String[] args)
    Deprecated.
    Get all stacks in a given User's inventory that matches the given arguments.
    boolean
    Deprecated.
    Check whether the item database is loaded and ready for use.
    Deprecated.
    Return names recognised by the database, intended for tab-completion.
    Deprecated.
    Get the primary name for the given item stack.
    Deprecated.
    Get a List of all aliases for the given item stack.
    default String
    Deprecated.
    Get a comma-separated string list of up to 15 aliases for the given stack.
    Deprecated.
    Converts the given ItemStack to a string representation that can be saved.
  • Method Details

    • get

      default ItemStack get(String name, int quantity) throws Exception
      Deprecated.
      Create a stack from the given name with the given quantity.
      Parameters:
      name - Item name to look up in the database
      quantity - Quantity of the item stack
      Returns:
      The requested item stack
      Throws:
      Exception - if the item stack cannot be created
    • get

      ItemStack get(String name) throws Exception
      Deprecated.
      Create a stack from the given name with the maximum stack size for that material.

      Note that this will always check against resolver functions from other plugins as well. To avoid this behaviour, use net.ess3.api.IItemDb#get(String name, boolean useResolvers).

      Parameters:
      name - Item name to look up in the database
      Returns:
      The requested item stack with the maximum stack size
      Throws:
      Exception - if the item stack cannot be created
    • names

      default String names(ItemStack item)
      Deprecated.
      Get a comma-separated string list of up to 15 aliases for the given stack.
      Parameters:
      item - Item stack whose names to find
      Returns:
      Comma-separated list of up to 15 item names
    • nameList

      List<String> nameList(ItemStack item)
      Deprecated.
      Get a List of all aliases for the given item stack.
      Parameters:
      item - Item stack whose names to find
      Returns:
      List of all names
    • name

      String name(ItemStack item)
      Deprecated.
      Get the primary name for the given item stack.
      Parameters:
      item - Item stack whose name to find
      Returns:
      Primary name of the item
    • getMatching

      List<ItemStack> getMatching(User user, String[] args) throws Exception
      Deprecated.
      Get all stacks in a given User's inventory that matches the given arguments.
      Parameters:
      user - The user with the player inventory to search
      args - Either an item name, or one of the following: hand (default), inventory/invent/all, blocks
      Returns:
      A List of all matching ItemStacks
      Throws:
      Exception - if the given args are invalid or no blocks are found
    • serialize

      String serialize(ItemStack is)
      Deprecated.
      Converts the given ItemStack to a string representation that can be saved. This is typically used for /createkit but can be used by other plugins for various purposes too. Note that this will try registered resolvers first - to avoid this, use IItemDb.serialize(ItemStack, boolean) instead.
      Parameters:
      is - The stack to serialize
      Returns:
      A string representing the given stack
    • listNames

      Collection<String> listNames()
      Deprecated.
      Return names recognised by the database, intended for tab-completion.
      Returns:
      Collection of all item names
    • getFromLegacyId

      @Deprecated default Material getFromLegacyId(int id)
      Deprecated.
      Get the material matching the given legacy ID. Used for conversion from item IDs to modern names.
      Parameters:
      id - Legacy ID of material to find
      Returns:
      Updated material
    • getLegacyId

      @Deprecated int getLegacyId(Material material) throws Exception
      Deprecated.
      Item IDs are no longer supported.
      Get the legacy ID for the given material.
      Parameters:
      material - Material to look up
      Returns:
      Legacy ID of given material
      Throws:
      Exception - if the ID cannot be looked up
    • getFromLegacy

      default Material getFromLegacy(String item)
      Deprecated.
      Convert colon syntax (eg. "13", "1:5") legacy IDs to Material. Used for conversion from item IDs to modern names.
      Parameters:
      item - Legacy ID in colon syntax.
      Returns:
      Material if an appropriate material exists, else null.
    • getFromLegacy

      default Material getFromLegacy(int id, byte damage)
      Deprecated.
      Convert legacy ID and damage value to Material. Used for conversion from item IDs to modern names.
      Parameters:
      id - Legacy ID
      damage - Damage value
      Returns:
      Material
    • isReady

      boolean isReady()
      Deprecated.
      Check whether the item database is loaded and ready for use.
      Returns:
      Whether items have finished loading