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 Type
    Method
    Description
    @Nullable String
    getCustomItemId(@Nullable org.bukkit.inventory.ItemStack itemStack)
    Returns the custom item identifier for an item.
    @NotNull String
    Unique identifier used as the serialization prefix.
    @Nullable org.bukkit.inventory.ItemStack
    rebuildCustomItem(@NotNull String itemId, int amount)
    Rebuilds an item from a previously stored custom item id.
  • Method Details

    • getProviderId

      @NotNull @NotNull String 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. Returning null indicates 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 identifier
      amount - desired amount
      Returns:
      rebuilt item or null if restoration failed