use of com.electronwill.nightconfig.core.file.CommentedFileConfig in project CustomizableElytra by Hidoni.
the class Config method loadConfig.
public static void loadConfig(ForgeConfigSpec config, String path) {
CustomizableElytra.LOGGER.debug("Beginning config loading!");
final CommentedFileConfig file = CommentedFileConfig.builder(new File(path)).sync().autosave().writingMode(WritingMode.REPLACE).preserveInsertionOrder().build();
file.load();
config.setConfig(file);
CustomizableElytra.LOGGER.debug("Finished config loading!");
}
use of com.electronwill.nightconfig.core.file.CommentedFileConfig in project Lootr by noobanidus.
the class ConfigManager method loadConfig.
public static void loadConfig(ForgeConfigSpec spec, Path path) {
CommentedFileConfig configData = CommentedFileConfig.builder(path).sync().autosave().writingMode(WritingMode.REPLACE).build();
configData.load();
spec.setConfig(configData);
}
use of com.electronwill.nightconfig.core.file.CommentedFileConfig in project Mohist by MohistMC.
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 MysticalWorld by MysticMods.
the class ConfigManager method loadConfig.
public static void loadConfig(ForgeConfigSpec spec, Path path) {
CommentedFileConfig configData = CommentedFileConfig.builder(path).sync().autosave().writingMode(WritingMode.REPLACE).build();
configData.load();
spec.setConfig(configData);
}
use of com.electronwill.nightconfig.core.file.CommentedFileConfig in project Shrines by Silverminer007.
the class Config method loadConfig.
public static void loadConfig(ForgeConfigSpec config, String path) {
final CommentedFileConfig file = CommentedFileConfig.builder(new File(path)).preserveInsertionOrder().sync().autosave().writingMode(WritingMode.REPLACE).build();
file.load();
config.setConfig(file);
}
Aggregations