Package net.blueva.arcade.api.ui
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 Summary
Modifier and TypeMethodDescriptionApply formatted display name and lore to an existing item.Apply formatted display name and lore using player-aware placeholders.formatDisplayName(String displayName) Format a display name using BlueArcade's color pipeline.formatInventoryTitle(String title) Format an inventory title using BlueArcade's color pipeline.formatLore(List<String> lore) Format lore lines using BlueArcade's color pipeline.default voidregisterClickHandler(String itemId, ItemClickHandler<P> handler) Register a custom click handler for a lobby waiting item.default voidregisterWaitingItem(String moduleId, LobbyItemDefinition<M> item) Register a waiting lobby item scoped to a specific module/game id.voidRegister a waiting lobby item.default voidunregisterClickHandler(String itemId) Unregister a previously registered click handler.voidunregisterWaitingItem(String itemId) Unregister a waiting lobby item by id.
-
Method Details
-
registerWaitingItem
Register a waiting lobby item.- Parameters:
item- Lobby item definition
-
registerWaitingItem
Register a waiting lobby item scoped to a specific module/game id.- Parameters:
moduleId- Module/game id that owns the itemitem- Lobby item definition
-
unregisterWaitingItem
Unregister a waiting lobby item by id.- Parameters:
itemId- Item id
-
decorate
Apply formatted display name and lore to an existing item.- Parameters:
item- Base item stackdisplayName- 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 stackdisplayName- 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
Format a display name using BlueArcade's color pipeline.- Parameters:
displayName- Raw display name- Returns:
- Formatted legacy string ready for ItemMeta#setDisplayName
-
formatLore
Format lore lines using BlueArcade's color pipeline.- Parameters:
lore- Raw lore lines- Returns:
- Formatted lore lines ready for ItemMeta#setLore
-
formatInventoryTitle
Format an inventory title using BlueArcade's color pipeline.- Parameters:
title- Raw title- Returns:
- Formatted legacy title string for inventory creation
-
registerClickHandler
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 inLobbyItemDefinition)handler- Handler to execute on item click- Since:
- 3.3
-
unregisterClickHandler
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
-