*/
@Override
public YAMLProcessor createConfiguration() {
final File configFile = new File(getDataFolder(), "config.yml");
YAMLProcessor config = new YAMLProcessor(configFile, true, YAMLFormat.EXTENDED);
YAMLProcessor comments = new DefaultsFileYAMLProcessor("config-comments.yml", false);
try {
if (!configFile.exists()) {
configFile.getParentFile().mkdirs();
configFile.createNewFile();
}
config.load();
comments.load();
} catch (Exception e) {
getLogger().log(Level.WARNING, "Error loading configuration: ", e);
}
for (Map.Entry<String, Object> e : comments.getMap().entrySet()) {
if (e.getValue() != null) {
config.setComment(e.getKey(), e.getValue().toString());
}
}