MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / loadConfig

Method loadConfig

The 5zig Mod/src/eu/the5zig/mod/The5zigMod.java:301–313  ·  view source on GitHub ↗

Tries to load the Main Configuration File. @throws IOException if there was a problem loading the Configuration.

()

Source from the content-addressed store, hash-verified

299 * @throws IOException if there was a problem loading the Configuration.
300 */
301 private static void loadConfig() throws IOException {
302 File configFile = new File(modDirectory, "config.json");
303 if (!configFile.exists() && !configFile.createNewFile()) {
304 throw new IOException("Could not create Configuration!");
305 }
306
307 config = new ConfigNew(configFile);
308 IntItem version = config.get("version", IntItem.class);
309 if (!version.isDefault()) {
310 config.reset();
311 }
312 The5zigMod.logger.info("Loaded Configurations!");
313 }
314
315 /**
316 * Configures the main logger.

Callers 1

initMethod · 0.95

Calls 3

getMethod · 0.65
isDefaultMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected