Interface ComponentPreviewHandler<T>
- Type Parameters:
T- The visual object type used by the client's graphical interface (e.g.,org.bukkit.inventory.ItemStackfor a Spigot/Paper plugin)
public interface ComponentPreviewHandler<T>
Project Tachyon
Class ComponentPreviewHandler
Interface defining the preview handler for a specific component type.
This handler bridges the gap between the raw data stored in the database and the user interface. It is responsible for translating Protobuf messages into understandable visual elements that can be displayed in menus.
- Since:
- 1.0.0-SNAPSHOT
- Version:
- 1.0
- Author:
- Jimmy (vSKAH) - 17/04/2026
-
Method Summary
Modifier and TypeMethodDescription<C extends tech.skworks.tachyon.libs.com.google.protobuf.Message>
T[]buildComponentDataDisplay(C message) Builds the detailed data display of the component from its Protobuf message.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
<C extends tech.skworks.tachyon.libs.com.google.protobuf.Message> T[] buildComponentDataDisplay(C message) Builds the detailed data display of the component from its Protobuf message.This method takes the decoded business data 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).
- Type Parameters:
C- The specific type of the Protobuf message (must implementMessage).- Parameters:
message- The Protobuf message instance containing the raw player data for this component.- Returns:
- An array of visual objects (of type
T) representing the complete and formatted content of the component.
-