Class DynamicPropertyTypeRegistry
java.lang.Object
johnsmith.configoverhauled.api.registry.DynamicPropertyTypeRegistry
Central registry for dynamic configuration property types.
Maps namespaced string identifiers to their respective
DynamicPropertyTypeRegistry.TypeDefinition instances,
enabling the dynamic parsing and instantiation of properties at runtime.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordEncapsulates the configuration requirements for a specific property type. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DynamicPropertyTypeRegistry.TypeDefinition<Integer> Represents a dynamically instantiable 32-bit ARGB color property.static final DynamicPropertyTypeRegistry.TypeDefinition<net.minecraft.world.level.block.Block> Represents a dynamically instantiable Minecraft Block property.static final DynamicPropertyTypeRegistry.TypeDefinition<List<net.minecraft.world.level.block.Block>> Represents a dynamically instantiable list of Minecraft Blocks property.static final DynamicPropertyTypeRegistry.TypeDefinition<Boolean> Represents a dynamically instantiable boolean property.static final DynamicPropertyTypeRegistry.TypeDefinition<Double> Represents a dynamically instantiable double-precision floating-point property.static final DynamicPropertyTypeRegistry.TypeDefinition<Float> Represents a dynamically instantiable floating-point property.static final DynamicPropertyTypeRegistry.TypeDefinition<Integer> Represents a dynamically instantiable integer property.static final DynamicPropertyTypeRegistry.TypeDefinition<net.minecraft.world.item.Item> Represents a dynamically instantiable Minecraft Item property.static final DynamicPropertyTypeRegistry.TypeDefinition<List<net.minecraft.world.item.Item>> Represents a dynamically instantiable list of Minecraft Items property.static final DynamicPropertyTypeRegistry.TypeDefinition<Long> Represents a dynamically instantiable long integer property.static final DynamicPropertyTypeRegistry.TypeDefinition<Integer> Represents a dynamically instantiable 24-bit RGB color property.static final DynamicPropertyTypeRegistry.TypeDefinition<String> Represents a dynamically instantiable string property. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves a registered property type definition by its absolute identifier.static <T> DynamicPropertyTypeRegistry.TypeDefinition<T> register(String modId, String typeId, com.mojang.serialization.Codec<T> codec, PropertyFactory<T> factory) Registers a new dynamic property type definition.
-
Field Details
-
FLOAT
Represents a dynamically instantiable floating-point property. -
INTEGER
Represents a dynamically instantiable integer property. -
DOUBLE
Represents a dynamically instantiable double-precision floating-point property. -
LONG
Represents a dynamically instantiable long integer property. -
RGB_COLOR
Represents a dynamically instantiable 24-bit RGB color property. -
ARGB_COLOR
Represents a dynamically instantiable 32-bit ARGB color property. -
BOOLEAN
Represents a dynamically instantiable boolean property. -
STRING
Represents a dynamically instantiable string property. -
BLOCK
public static final DynamicPropertyTypeRegistry.TypeDefinition<net.minecraft.world.level.block.Block> BLOCKRepresents a dynamically instantiable Minecraft Block property. -
ITEM
Represents a dynamically instantiable Minecraft Item property. -
BLOCKS
public static final DynamicPropertyTypeRegistry.TypeDefinition<List<net.minecraft.world.level.block.Block>> BLOCKSRepresents a dynamically instantiable list of Minecraft Blocks property. -
ITEMS
public static final DynamicPropertyTypeRegistry.TypeDefinition<List<net.minecraft.world.item.Item>> ITEMSRepresents a dynamically instantiable list of Minecraft Items property.
-
-
Constructor Details
-
DynamicPropertyTypeRegistry
public DynamicPropertyTypeRegistry()
-
-
Method Details
-
register
public static <T> DynamicPropertyTypeRegistry.TypeDefinition<T> register(String modId, String typeId, com.mojang.serialization.Codec<T> codec, PropertyFactory<T> factory) Registers a new dynamic property type definition.- Type Parameters:
T- The underlying data type.- Parameters:
modId- The namespace ID of the mod registering the type.typeId- The unique identifier for the type within the namespace.codec- The codec responsible for processing the underlying data type.factory- The factory sequence executing the property construction.- Returns:
- The registered
DynamicPropertyTypeRegistry.TypeDefinition. - Throws:
IllegalArgumentException- If either the modId or typeId is null.
-
get
Retrieves a registered property type definition by its absolute identifier.- Parameters:
id- The absolute namespaced identifier (e.g., "modid:type").- Returns:
- The matching
DynamicPropertyTypeRegistry.TypeDefinition. - Throws:
IllegalStateException- If the requested identifier is not registered.
-