Interface CustomItemStorageProvider
- All Known Implementing Classes:
CraftEngine
public interface CustomItemStorageProvider
Provides custom item serialization and restoration support for
third-party item systems such as CraftEngine, Oraxen,
ItemsAdder, MMOItems, MythicCrucible, etc.
-
Method Summary
Modifier and TypeMethodDescription@Nullable StringgetCustomItemId(@Nullable org.bukkit.inventory.ItemStack itemStack) Returns the custom item identifier for an item.@NotNull StringUnique identifier used as the serialization prefix.@Nullable org.bukkit.inventory.ItemStackrebuildCustomItem(@NotNull String itemId, int amount) Rebuilds an item from a previously stored custom item id.
-
Method Details
-
getProviderId
Unique identifier used as the serialization prefix. Example:CRAFTENGINE ORAXEN ITEMSADDER MMOITEMS
Serialized format:PROVIDER_ID:encoded-item-id:base64-item
- Returns:
- provider identifier
-
getCustomItemId
@Nullable @Nullable String getCustomItemId(@Nullable @Nullable org.bukkit.inventory.ItemStack itemStack) Returns the custom item identifier for an item. Returningnullindicates the item is not handled by this provider.- Parameters:
itemStack- item to inspect- Returns:
- custom item identifier or null
-
rebuildCustomItem
@Nullable @Nullable org.bukkit.inventory.ItemStack rebuildCustomItem(@NotNull @NotNull String itemId, int amount) Rebuilds an item from a previously stored custom item id.- Parameters:
itemId- custom item identifieramount- desired amount- Returns:
- rebuilt item or null if restoration failed
-