Interface ComponentPreviewHandler<T, R extends Record>
- Type Parameters:
T- The visual object type used by the client's graphical interface (e.g.,org.bukkit.inventory.ItemStackfor a Spigot/Paper plugin)R- The specific component Record type (must extendRecord)
- All Known Implementing Classes:
CookieComponent.CookieComponentCodec
public interface ComponentPreviewHandler<T, R extends Record>
Project Tachyon
Interface ComponentPreviewHandler
Interface defining the preview handler for a specific component type.
This handler bridges the gap between the raw component data and the user interface. It is responsible for translating component records or BSON data into understandable visual elements that can be displayed in menus.
- Since:
- 1.0.0-SNAPSHOT
- Version:
- 2.0
- Author:
- Jimmy (vSKAH) - 17/04/2026
-
Method Summary
Modifier and TypeMethodDescriptionT[]buildComponentDataDisplay(R record) Builds the detailed data display of the component from its Record instance.Builds the global representative icon for this component.
-
Method Details
-
buildComponentIcon
T buildComponentIcon()Builds the global representative icon for this component.This icon is typically used in selection and navigation menus (for example, in the sub-menu of a FULL snapshot to list all components available for viewing).
- Returns:
- The visual object (of type
T) serving as the icon to represent this component.
-
buildComponentDataDisplay
Builds the detailed data display of the component from its Record instance.This method takes the decoded business data record and transforms it into a structured set of visual elements. The returned array will be directly injected into the final inventory or preview menu (e.g., the exact layout of items in an Enderchest, or a paginated list of statistics).
- Parameters:
record- The Record instance containing the player data for this component.- Returns:
- An array of visual objects (of type
T) representing the complete and formatted content of the component.
-