Class ConfigRegistry
java.lang.Object
johnsmith.configoverhauled.api.registry.ConfigRegistry
Centralized registry for managing and retrieving active configuration managers across all dependent mods.
Utilizes the Java ServiceLoader to dynamically resolve platform-specific factory implementations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<ConfigManager> Retrieves all currently active configuration managers.Retrieves a list of all mod identifiers actively utilizing the framework.static ConfigManagergetManager(String modId) Retrieves the registered configuration manager for a specific mod identifier.static ConfigManagergetOrCreateManager(String modId) Retrieves an existing configuration manager or structurally allocates a new instance via the resolved factory.static voidregisterManager(ConfigManager manager) Binds an initialized configuration manager to the registry under its respective mod identifier.static voidInstructs all registered configuration managers to execute synchronous disk-write operations.
-
Constructor Details
-
ConfigRegistry
public ConfigRegistry()
-
-
Method Details
-
registerManager
Binds an initialized configuration manager to the registry under its respective mod identifier.- Parameters:
manager- The configuration manager instance to register.
-
getManager
Retrieves the registered configuration manager for a specific mod identifier.- Parameters:
modId- The target mod identifier.- Returns:
- The associated configuration manager, or null if unassigned.
-
getOrCreateManager
Retrieves an existing configuration manager or structurally allocates a new instance via the resolved factory. Implements thread-safe double-checked locking to prevent race conditions during concurrent initialization.- Parameters:
modId- The target mod identifier.- Returns:
- A valid configuration manager scoped to the provided identifier.
-
saveAllSynchronously
public static void saveAllSynchronously()Instructs all registered configuration managers to execute synchronous disk-write operations. -
getAllManagers
Retrieves all currently active configuration managers.- Returns:
- A collection of registered configuration managers.
-
getDependentModIDs
-