Package net.minecraftforge.resource
Class ResourceCacheManager.ResourceManagerBootCacheConfigurationHandler
java.lang.Object
net.minecraftforge.resource.ResourceCacheManager.ResourceManagerBootCacheConfigurationHandler
- Enclosing class:
- ResourceCacheManager
private static final class ResourceCacheManager.ResourceManagerBootCacheConfigurationHandler
extends Object
Class to handle the reading, initial creation, and watching of the boot configuration file, for the resource cache manager.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PathThe path to the boot configuration file.private static final com.electronwill.nightconfig.core.ConfigSpecThe configuration specification for the resource cache configuration.private final com.electronwill.nightconfig.core.file.CommentedFileConfigThe configuration handle for the resource cache configuration.private static final ResourceCacheManager.ResourceManagerBootCacheConfigurationHandlerThe current instance of the handler.private static final org.slf4j.LoggerThe logger for theResourceCacheManager.ResourceManagerBootCacheConfigurationHandler -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCreates a new instance of the handler. -
Method Summary
Modifier and TypeMethodDescriptionprivate static com.electronwill.nightconfig.core.file.CommentedFileConfigCreates the configuration handle for the resource cache configuration.private booleangetConfigValue(String configKey, boolean defaultValue) Reads a config value from the current configuration file.Gives access to the current singleton instance of the handler.private static booleanonConfigFileNotFound(Path file, com.electronwill.nightconfig.core.ConfigFormat<?> configFormat)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGERThe logger for theResourceCacheManager.ResourceManagerBootCacheConfigurationHandler -
CONFIG_PATH
The path to the boot configuration file. -
configSpec
private static final com.electronwill.nightconfig.core.ConfigSpec configSpecThe configuration specification for the resource cache configuration. -
INSTANCE
The current instance of the handler. -
configurationHandle
private final com.electronwill.nightconfig.core.file.CommentedFileConfig configurationHandleThe configuration handle for the resource cache configuration.
-
-
Constructor Details
-
ResourceManagerBootCacheConfigurationHandler
private ResourceManagerBootCacheConfigurationHandler()Creates a new instance of the handler. Registers the watchdog thread.
-
-
Method Details
-
createConfiguration
private static com.electronwill.nightconfig.core.file.CommentedFileConfig createConfiguration()Creates the configuration handle for the resource cache configuration. -
onConfigFileNotFound
private static boolean onConfigFileNotFound(Path file, com.electronwill.nightconfig.core.ConfigFormat<?> configFormat) throws IOException - Throws:
IOException
-
getInstance
Gives access to the current singleton instance of the handler.- Returns:
- The instance of this handler.
-
getConfigValue
Reads a config value from the current configuration file.- Parameters:
configKey- The key of the config value to read.defaultValue- The default value to return if the config value is not present.- Returns:
- The value of the config value, or the default value if it is not present.
-