use of com.electronwill.nightconfig.core.file.CommentedFileConfig in project JustEnoughResources by way2muchnoise.
the class Config method loadConfig.
public void loadConfig(ForgeConfigSpec spec, Path path) {
JEResources.LOGGER.debug("Loading config file {}", path);
final CommentedFileConfig configData = CommentedFileConfig.builder(path).sync().autosave().writingMode(WritingMode.REPLACE).build();
JEResources.LOGGER.debug("Built TOML config for {}", path.toString());
configData.load();
JEResources.LOGGER.debug("Loaded TOML config file {}", path.toString());
spec.setConfig(configData);
ConfigValues.pushChanges();
}
use of com.electronwill.nightconfig.core.file.CommentedFileConfig in project MinecraftForge by MinecraftForge.
the class ConfigTracker method openConfig.
private void openConfig(final ModConfig config, final Path configBasePath) {
LOGGER.trace(CONFIG, "Loading config file type {} at {} for {}", config.getType(), config.getFileName(), config.getModId());
final CommentedFileConfig configData = config.getHandler().reader(configBasePath).apply(config);
config.setConfigData(configData);
config.fireEvent(IConfigEvent.loading(config));
config.save();
}
use of com.electronwill.nightconfig.core.file.CommentedFileConfig in project Fragile-Glass by fredtargaryen.
the class Config method loadConfig.
public static void loadConfig(Path path) {
final CommentedFileConfig configData = CommentedFileConfig.builder(path).sync().autosave().writingMode(WritingMode.REPLACE).build();
configData.load();
COMMON_CONFIG_SPEC.setConfig(configData);
}
use of com.electronwill.nightconfig.core.file.CommentedFileConfig in project xercamods by ercanserteli.
the class Config method loadConfig.
public static void loadConfig(ForgeConfigSpec spec, Path path) {
final CommentedFileConfig configData = CommentedFileConfig.builder(path).sync().autosave().writingMode(WritingMode.REPLACE).build();
configData.load();
spec.setConfig(configData);
bakeConfig();
}
use of com.electronwill.nightconfig.core.file.CommentedFileConfig in project RFToolsUtility by McJtyMods.
the class Config method loadConfig.
public static void loadConfig(ForgeConfigSpec spec, Path path) {
final CommentedFileConfig configData = CommentedFileConfig.builder(path).sync().autosave().writingMode(WritingMode.REPLACE).build();
configData.load();
spec.setConfig(configData);
}
Aggregations