Class DefaultConfigManager
java.lang.Object
johnsmith.configoverhauled.impl.core.DefaultConfigManager
- All Implemented Interfaces:
ConfigManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattachServerConfig(net.minecraft.server.MinecraftServer server) Allocates dynamic disk paths and executes parsing for the LEVEL scope tied to the active world instance.<S> ScreateScreen(S parent) Triggers dynamic GUI generation for the active configuration hierarchy.Resolves an existing category or constructs a new structural boundary.Property<?> findProperty(ConfigDescription description) Traverses the active structural hierarchy to resolve a property matching exact logical coordinates.Retrieves all structurally active categories.Retrieves the target disk directory assigned during initialization.getGroupsIn(Category category) Retrieves all structural groups bound to the specific category.Property<?> getOrCreateDynamicProperty(ConfigDescription description, DynamicPropertyTypeRegistry.TypeDefinition<?> typeDefinition, Object defaultValue, Object min, Object max) Allocates a dynamic property instance at runtime, matching specific coordinate definitions.getPropertiesIn(Group group) Retrieves all properties actively bound to the specified group.voidAllocates primary disk paths and executes initial parsing for CLIENT and GLOBAL scopes.voidload()Executes a synchronous disk read across all configuration scopes.voidloadScope(ConfigScope targetScope) Forces a synchronous disk read operation for all properties bound to the specified scope.voidvoidorg.slf4j.Loggerlogger()Retrieves the delegated logging framework instance.voidvoidmodId()Retrieves the bound namespace identifier.registerGroup(Category category, String id) Resolves an existing group or constructs a new structural entity within the specified category.<T> voidregisterProperty(Property<T> config) Injects a property into the active configuration memory state and synchronizes it with disk definitions.voidExecutes hierarchical teardown and unbinds a target category and all dependencies.voidExecutes hierarchical teardown and unbinds a target group and all dependencies.voidDetaches a specific property from the active memory state.voidsave()Executes a synchronous disk write across all configuration scopes.saveAll()Dispatches an asynchronous disk write operation across all configuration scopes.voidsaveScope(ConfigScope targetScope) Forces a synchronous disk write operation for all properties bound to the specified scope.voidsetScreenFactory(Function<Object, Object> factory) Injects a custom screen factory to override default interface rendering protocols.
-
Constructor Details
-
DefaultConfigManager
-
-
Method Details
-
modId
Description copied from interface:ConfigManagerRetrieves the bound namespace identifier.- Specified by:
modIdin interfaceConfigManager- Returns:
- The registered mod ID.
-
logger
public org.slf4j.Logger logger()Description copied from interface:ConfigManagerRetrieves the delegated logging framework instance.- Specified by:
loggerin interfaceConfigManager- Returns:
- The SLF4J logger.
-
init
Description copied from interface:ConfigManagerAllocates primary disk paths and executes initial parsing for CLIENT and GLOBAL scopes.- Specified by:
initin interfaceConfigManager- Parameters:
configDirectory- The root configuration path provided by the platform environment.
-
attachServerConfig
public void attachServerConfig(net.minecraft.server.MinecraftServer server) Description copied from interface:ConfigManagerAllocates dynamic disk paths and executes parsing for the LEVEL scope tied to the active world instance.- Specified by:
attachServerConfigin interfaceConfigManager- Parameters:
server- The active Minecraft server instance.
-
loadScope
Description copied from interface:ConfigManagerForces a synchronous disk read operation for all properties bound to the specified scope.- Specified by:
loadScopein interfaceConfigManager- Parameters:
targetScope- The target synchronization scope.
-
saveScope
Description copied from interface:ConfigManagerForces a synchronous disk write operation for all properties bound to the specified scope.- Specified by:
saveScopein interfaceConfigManager- Parameters:
targetScope- The target synchronization scope.
-
load
public void load()Description copied from interface:ConfigManagerExecutes a synchronous disk read across all configuration scopes.- Specified by:
loadin interfaceConfigManager
-
save
public void save()Description copied from interface:ConfigManagerExecutes a synchronous disk write across all configuration scopes.- Specified by:
savein interfaceConfigManager
-
saveAll
Description copied from interface:ConfigManagerDispatches an asynchronous disk write operation across all configuration scopes.- Specified by:
saveAllin interfaceConfigManager- Returns:
- A CompletableFuture representing the state of the I/O execution.
-
logInfo
- Specified by:
logInfoin interfaceConfigManager
-
logWarn
- Specified by:
logWarnin interfaceConfigManager
-
logError
- Specified by:
logErrorin interfaceConfigManager
-
logDebug
- Specified by:
logDebugin interfaceConfigManager
-
define
Description copied from interface:ConfigManagerResolves an existing category or constructs a new structural boundary.- Specified by:
definein interfaceConfigManager- Parameters:
id- The category identifier.- Returns:
- The bound Category instance.
-
registerGroup
Description copied from interface:ConfigManagerResolves an existing group or constructs a new structural entity within the specified category.- Specified by:
registerGroupin interfaceConfigManager- Parameters:
category- The parent structural boundary.id- The group identifier.- Returns:
- The bound Group instance.
-
registerProperty
Description copied from interface:ConfigManagerInjects a property into the active configuration memory state and synchronizes it with disk definitions.- Specified by:
registerPropertyin interfaceConfigManager- Parameters:
config- The structural property definition.
-
getOrCreateDynamicProperty
public Property<?> getOrCreateDynamicProperty(ConfigDescription description, DynamicPropertyTypeRegistry.TypeDefinition<?> typeDefinition, Object defaultValue, Object min, Object max) Description copied from interface:ConfigManagerAllocates a dynamic property instance at runtime, matching specific coordinate definitions. Utilized primarily for datapack injection or authoritative server synchronization.- Specified by:
getOrCreateDynamicPropertyin interfaceConfigManager- Parameters:
description- The absolute coordinate map.typeDefinition- The underlying data class.defaultValue- The baseline state value.min- The lower validation boundary.max- The upper validation boundary.- Returns:
- The dynamically constructed Property instance.
-
remove
Description copied from interface:ConfigManagerExecutes hierarchical teardown and unbinds a target category and all dependencies.- Specified by:
removein interfaceConfigManager
-
remove
Description copied from interface:ConfigManagerExecutes hierarchical teardown and unbinds a target group and all dependencies.- Specified by:
removein interfaceConfigManager
-
remove
Description copied from interface:ConfigManagerDetaches a specific property from the active memory state.- Specified by:
removein interfaceConfigManager
-
getCategories
Description copied from interface:ConfigManagerRetrieves all structurally active categories.- Specified by:
getCategoriesin interfaceConfigManager
-
getGroupsIn
Description copied from interface:ConfigManagerRetrieves all structural groups bound to the specific category.- Specified by:
getGroupsInin interfaceConfigManager
-
getPropertiesIn
Description copied from interface:ConfigManagerRetrieves all properties actively bound to the specified group.- Specified by:
getPropertiesInin interfaceConfigManager
-
getConfigDirectory
Description copied from interface:ConfigManagerRetrieves the target disk directory assigned during initialization.- Specified by:
getConfigDirectoryin interfaceConfigManager
-
findProperty
Description copied from interface:ConfigManagerTraverses the active structural hierarchy to resolve a property matching exact logical coordinates.- Specified by:
findPropertyin interfaceConfigManager- Parameters:
description- The exact definition map.- Returns:
- The resolved Property instance, or null if unbound.
-
setScreenFactory
Description copied from interface:ConfigManagerInjects a custom screen factory to override default interface rendering protocols. Execute binding prior to platform-specific GUI endpoint registration.- Specified by:
setScreenFactoryin interfaceConfigManager- Parameters:
factory- The functional screen construction sequence.
-
createScreen
public <S> S createScreen(S parent) Description copied from interface:ConfigManagerTriggers dynamic GUI generation for the active configuration hierarchy.- Specified by:
createScreenin interfaceConfigManager- Parameters:
parent- The preceding menu screen entity.- Returns:
- The constructed configuration screen entity.
-