Class DeferredRegister.DataComponents
java.lang.Object
net.neoforged.neoforge.registries.DeferredRegister<DataComponentType<?>>
net.neoforged.neoforge.registries.DeferredRegister.DataComponents
- Enclosing class:
DeferredRegister<T>
Specialized DeferredRegister for
DataComponentTypes
.-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.registries.DeferredRegister
DeferredRegister.Blocks, DeferredRegister.DataComponents, DeferredRegister.Items
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<D> DeferredHolder
<DataComponentType<?>, DataComponentType<D>> registerComponentType
(String name, UnaryOperator<DataComponentType.Builder<D>> builder) Convenience method that constructs a builder for use in the operator.Methods inherited from class net.neoforged.neoforge.registries.DeferredRegister
addAlias, create, create, create, createBlocks, createDataComponents, createHolder, createItems, createTagKey, createTagKey, getEntries, getNamespace, getRegistry, getRegistryKey, getRegistryName, makeRegistry, register, register, register
-
Constructor Details
-
DataComponents
-
-
Method Details
-
registerComponentType
public <D> DeferredHolder<DataComponentType<?>,DataComponentType<D>> registerComponentType(String name, UnaryOperator<DataComponentType.Builder<D>> builder) Convenience method that constructs a builder for use in the operator. Use this to avoid inference issues.- Parameters:
name
- The name for this data component type. It will automatically have the namespace prefixed.builder
- The unary operator, which is passed a new builder for user operations, then builds it upon registration.- Returns:
- A
DeferredHolder
which reflects the data that will be registered.
-