crwdns151271:0crwdne151271:0

crwdns151273:0:javadoc:crwdne151273:0

crwdns151275:0crwdne151275:0

Note

crwdns151277:0:javadoc:crwdnd151277:0:doc:crwdne151277:0

crwdns151279:0:javadoc:crwdne151279:0

import java.nio.file.Path;
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
import ninja.leaping.configurate.hocon.HoconConfigurationLoader;
import ninja.leaping.configurate.loader.ConfigurationLoader;

Path potentialFile = getConfigPath();
ConfigurationLoader<CommentedConfigurationNode> loader =
  HoconConfigurationLoader.builder().setPath(potentialFile).build();

crwdns151281:0:doc:crwdne151281:0

crwdns151283:0crwdne151283:0

crwdns151285:0crwdne151285:0

crwdns151287:0crwdne151287:0

crwdns151289:0crwdne151289:0

crwdns151291:0:javadoc:crwdne151291:0

import ninja.leaping.configurate.ConfigurationNode;
import ninja.leaping.configurate.ConfigurationOptions;

Path potentialFile = getConfigPath();
ConfigurationLoader<CommentedConfigurationNode> loader = HoconConfigurationLoader.builder().setPath(potentialFile).build();
ConfigurationNode rootNode = loader.createEmptyNode(ConfigurationOptions.defaults());

crwdns151293:0:javadoc:crwdne151293:0

crwdns151295:0crwdne151295:0

import java.io.IOException;

Path potentialFile = getConfigPath();
ConfigurationLoader<CommentedConfigurationNode> loader = HoconConfigurationLoader.builder().setPath(potentialFile).build();
ConfigurationNode rootNode;
try {
    rootNode = loader.load();
} catch(IOException e) {
    // error
}

crwdns151297:0crwdne151297:0

crwdns151299:0crwdne151299:0

crwdns151301:0crwdne151301:0

try {
    loader.save(rootNode);
} catch(IOException e) {
    // error
}

crwdns151303:0crwdne151303:0

crwdns151305:0crwdne151305:0

import java.net.URL;

URL jarConfigFile = Sponge.getAssetManager().getAsset("defaultConfig.conf").get().getUrl();
ConfigurationLoader<CommentedConfigurationNode> loader =
  HoconConfigurationLoader.builder().setURL(jarConfigFile).build();

crwdns151307:0:javadoc:crwdnd151307:0:doc:crwdne151307:0