Class ComponentRegistryImpl
java.lang.Object
tech.skworks.tachyon.plugin.core.component.ComponentRegistryImpl
- All Implemented Interfaces:
ComponentRegistry
Project Tachyon
Class ComponentRegistry
- Since:
- 1.0.0-SNAPSHOT
- Version:
- 1.0
- Author:
- Jimmy (vSKAH) - 08/04/2026
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<ComponentCodec<? extends Record>> <R extends Record>
@Nullable ComponentCodec<R> Retrieves a codec by its component Record class.<R extends Record>
@Nullable ComponentCodec<R> getCodec(@NotNull ComponentNamespace componentNamespace) <V, R extends Record>
@Nullable ComponentPreviewHandler<V, R> getPreviewHandler(@NotNull Class<R> recordClass) <R extends Record>
voidregisterCodec(@NotNull ComponentCodec<R> codec) Registers a new ComponentCodec.int<V, R extends Record>
voidregisterPreviewHandler(@NotNull Class<R> recordComponentClass, @NotNull ComponentPreviewHandler<V, R> previewHandler) Registers a new visual preview handler for a specific component.
-
Constructor Details
-
ComponentRegistryImpl
public ComponentRegistryImpl()
-
-
Method Details
-
registerCodec
Description copied from interface:ComponentRegistryRegisters a new ComponentCodec.- Specified by:
registerCodecin interfaceComponentRegistry- Type Parameters:
R- The specific record component type.- Parameters:
codec- The codec instance to register
-
registerPreviewHandler
public <V, R extends Record> void registerPreviewHandler(@NotNull @NotNull Class<R> recordComponentClass, @NotNull @NotNull ComponentPreviewHandler<V, R> previewHandler) Description copied from interface:ComponentRegistryRegisters a new visual preview handler for a specific component.- Specified by:
registerPreviewHandlerin interfaceComponentRegistry- Type Parameters:
V- The visual element type (ex ItemStack)R- The record component type.- Parameters:
recordComponentClass- The component record classpreviewHandler- The preview handler instance
-
getCodec
@Nullable public <R extends Record> @Nullable ComponentCodec<R> getCodec(Class<R> recordComponentClass) Description copied from interface:ComponentRegistryRetrieves a codec by its component Record class.- Specified by:
getCodecin interfaceComponentRegistry- Type Parameters:
R- The Record component type.- Parameters:
recordComponentClass- The Record class.- Returns:
- The registered codec or null if not found
-
getCodec
@Nullable public <R extends Record> @Nullable ComponentCodec<R> getCodec(@NotNull @NotNull ComponentNamespace componentNamespace) - Specified by:
getCodecin interfaceComponentRegistry
-
getPreviewHandler
@Nullable public <V, R extends Record> @Nullable ComponentPreviewHandler<V,R> getPreviewHandler(@NotNull @NotNull Class<R> recordClass) - Specified by:
getPreviewHandlerin interfaceComponentRegistry
-
getAllCodecs
- Specified by:
getAllCodecsin interfaceComponentRegistry
-
registeredCount
public int registeredCount()- Specified by:
registeredCountin interfaceComponentRegistry
-