Interface ComponentRegistry

Type Parameters:
V - The visual object type used by the ComponentPreviewHandler (e.g., org.bukkit.inventory.ItemStack for Spigot).
All Known Implementing Classes:
ComponentRegistryImpl

public interface ComponentRegistry
Project Tachyon Interface ComponentRegistry

The central hub for managing and resolving all Protobuf components within the Tachyon ecosystem.

This registry acts as the dictionary that bridges raw Protobuf data with concrete Java objects and their associated graphical user interfaces (Preview Handlers). It handles the dynamic unpacking of byte arrays into typed

invalid reference
Message
instances.

Since:
1.0.0-SNAPSHOT
Version:
2.0
Author:
Jimmy (vSKAH) - 18/04/2026
  • Method Details

    • registerCodec

      <R extends Record> void registerCodec(@NotNull @NotNull ComponentCodec<R> codec)
      Registers a new ComponentCodec.
      Type Parameters:
      R - The specific record component type.
      Parameters:
      codec - The codec instance to register
    • registerPreviewHandler

      <V, R extends Record> void registerPreviewHandler(@NotNull @NotNull Class<R> recordComponentClass, @NotNull @NotNull ComponentPreviewHandler<V,R> previewHandler)
      Registers a new visual preview handler for a specific component.
      Type Parameters:
      V - The visual element type (ex ItemStack)
      R - The record component type.
      Parameters:
      recordComponentClass - The component record class
      previewHandler - The preview handler instance
    • getCodec

      @Nullable <R extends Record> @Nullable ComponentCodec<R> getCodec(Class<R> recordComponentClass)
      Retrieves a codec by its component Record class.
      Type Parameters:
      R - The Record component type.
      Parameters:
      recordComponentClass - The Record class.
      Returns:
      The registered codec or null if not found
    • getCodec

      @Nullable <R extends Record> @Nullable ComponentCodec<R> getCodec(@NotNull @NotNull ComponentNamespace componentNamespace)
    • getPreviewHandler

      @Nullable <V, R extends Record> @Nullable ComponentPreviewHandler<V,R> getPreviewHandler(@NotNull @NotNull Class<R> recordClass)
    • registeredCount

      int registeredCount()
    • getAllCodecs

      Collection<ComponentCodec<? extends Record>> getAllCodecs()