Interface ItemProvider
<namespace>:<id>, next to Zentrix's built-in
custom:, itemsadder: and nexo: prefixes.
Once registered through ItemService.registerItemProvider(org.bukkit.plugin.Plugin, dev.itsharshxd.zentrix.api.item.ItemProvider), identifiers in the provider's
namespace work wherever Zentrix resolves or matches item identifiers through its item manager:
ItemService.resolveItem(java.lang.String), ItemService.matchesItem(org.bukkit.inventory.ItemStack, java.lang.String), and configuration that refers
to items by identifier when it is used, such as class bonus items. The material of
entries in content/items.yml is resolved when that file is read - at Zentrix's startup,
before dependent addons enable - so such entries resolve from the next /zentrix reload
after the provider registered. Loot pools store their items themselves and are not affected.
Calls come from the main thread and must be quick; a provider that throws is treated as not knowing the item.
- Since:
- 1.8.0
-
Method Summary
Modifier and TypeMethodDescription@Nullable org.bukkit.inventory.ItemStackcreateItem(@NotNull String id) Creates the item with this ID.Every item ID the provider knows, without the namespace, for suggestions and pickers.@NotNull StringThe namespace identifiers of this provider start with, without the colon: lowercasea-z,0-9,_and-.@Nullable Stringidentify(@NotNull org.bukkit.inventory.ItemStack item) The ID of an item this provider made, so Zentrix can match it against an identifier.default booleanWhether the provider can create items now, for instance once its own content has loaded.
-
Method Details
-
getNamespace
The namespace identifiers of this provider start with, without the colon: lowercasea-z,0-9,_and-.custom,itemsadder,nexo,minecraftandzentrixare reserved. -
isAvailable
default boolean isAvailable()Whether the provider can create items now, for instance once its own content has loaded. -
createItem
Creates the item with this ID.- Parameters:
id- the part after<namespace>:- Returns:
- a new stack, or null when no such item exists
-
identify
The ID of an item this provider made, so Zentrix can match it against an identifier.- Returns:
- the part after
<namespace>:, or null when the item is not one of this provider's
-
getItemIds
Every item ID the provider knows, without the namespace, for suggestions and pickers.
-