public static boolean load() { Plugin.log("Loading conf from disk"); if (!file.exists()) { Plugin.log("No conf to load from disk. Creating new file."); save(); return true; } try { Plugin.gson.fromJson(DiscUtil.read(file), Conf.class); } catch (IOException e) { e.printStackTrace(); Plugin.log("Failed to load the config from disk."); return false; } return true; }
public static boolean save() { // Factions.log("Saving config to disk."); try { DiscUtil.write(file, Plugin.gson.toJson(new Conf())); } catch (IOException e) { e.printStackTrace(); Plugin.log("Failed to save the config to disk."); return false; } return true; }