Package com.earth2me.essentials.api
Interface IItemDb
- All Known Subinterfaces:
IItemDb
- All Known Implementing Classes:
AbstractItemDb
,FlatItemDb
,LegacyItemDb
Deprecated.
Provides access to the current item alias registry.
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Create a stack from the given name with the maximum stack size for that material.default ItemStack
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
getFromLegacy
(String item) Deprecated.Convert colon syntax (eg.default Material
getFromLegacyId
(int id) Deprecated.int
getLegacyId
(Material material) 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
isReady()
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 givenItemStack
to a string representation that can be saved.
-
Method Details
-
get
Deprecated.Create a stack from the given name with the given quantity.- Parameters:
name
- Item name to look up in the databasequantity
- Quantity of the item stack- Returns:
- The requested item stack
- Throws:
Exception
- if the item stack cannot be created
-
get
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
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
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
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
Deprecated.Get all stacks in a given User's inventory that matches the given arguments.- Parameters:
user
- The user with the player inventory to searchargs
- 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
Deprecated.Converts the givenItemStack
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, useIItemDb.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.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.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
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
Deprecated.Convert legacy ID and damage value to Material. Used for conversion from item IDs to modern names.- Parameters:
id
- Legacy IDdamage
- 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
-
IItemDb
instead, which includes access toIItemDb.ItemResolver
APIs.