Interface ItemAPI<P,I,M>


public interface ItemAPI<P,I,M>
API for formatting and decorating items using the official color pipeline. Also owns lobby item registration to avoid duplicate entry points.
  • Method Details

    • registerWaitingItem

      void registerWaitingItem(LobbyItemDefinition<M> item)
      Register a waiting lobby item.
      Parameters:
      item - Lobby item definition
    • registerWaitingItem

      default void registerWaitingItem(String moduleId, LobbyItemDefinition<M> item)
      Register a waiting lobby item scoped to a specific module/game id.
      Parameters:
      moduleId - Module/game id that owns the item
      item - Lobby item definition
    • unregisterWaitingItem

      void unregisterWaitingItem(String itemId)
      Unregister a waiting lobby item by id.
      Parameters:
      itemId - Item id
    • decorate

      I decorate(I item, String displayName, List<String> lore)
      Apply formatted display name and lore to an existing item.
      Parameters:
      item - Base item stack
      displayName - Display name to apply (MiniMessage/legacy supported)
      lore - Lore lines to apply (MiniMessage/legacy supported)
      Returns:
      Decorated ItemStack instance
    • decorate

      I decorate(I item, String displayName, List<String> lore, P player, Map<String,String> placeholders)
      Apply formatted display name and lore using player-aware placeholders.
      Parameters:
      item - Base item stack
      displayName - Display name to apply (MiniMessage/legacy supported)
      lore - Lore lines to apply (MiniMessage/legacy supported)
      player - Player context for placeholders (can be null)
      placeholders - Additional placeholders to inject before formatting
      Returns:
      Decorated ItemStack instance
    • formatDisplayName

      String formatDisplayName(String displayName)
      Format a display name using BlueArcade's color pipeline.
      Parameters:
      displayName - Raw display name
      Returns:
      Formatted legacy string ready for ItemMeta#setDisplayName
    • formatLore

      List<String> formatLore(List<String> lore)
      Format lore lines using BlueArcade's color pipeline.
      Parameters:
      lore - Raw lore lines
      Returns:
      Formatted lore lines ready for ItemMeta#setLore
    • formatInventoryTitle

      String formatInventoryTitle(String title)
      Format an inventory title using BlueArcade's color pipeline.
      Parameters:
      title - Raw title
      Returns:
      Formatted legacy title string for inventory creation
    • registerClickHandler

      default void registerClickHandler(String itemId, ItemClickHandler<P> handler)
      Register a custom click handler for a lobby waiting item. The default implementation is a no-op; override in platform core implementations.
      Parameters:
      itemId - Item ID (must match the ID used in LobbyItemDefinition)
      handler - Handler to execute on item click
      Since:
      3.3
    • unregisterClickHandler

      default void unregisterClickHandler(String itemId)
      Unregister a previously registered click handler. The default implementation is a no-op; override in platform core implementations.
      Parameters:
      itemId - Item ID to unregister
      Since:
      3.3