diff options
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/internal/config/OneConfigConfig.java')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/internal/config/OneConfigConfig.java | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/config/OneConfigConfig.java b/src/main/java/cc/polyfrost/oneconfig/internal/config/OneConfigConfig.java index a0e25fc..1986e9e 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/config/OneConfigConfig.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/config/OneConfigConfig.java @@ -11,7 +11,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; -public class OneConfigConfig extends Config { +public class OneConfigConfig extends InternalConfig { public static String currentProfile = "Default Profile"; public static boolean autoUpdate = true; /** @@ -26,30 +26,6 @@ public class OneConfigConfig extends Config { public static boolean australia = false; public OneConfigConfig() { - super(null, "OneConfig.json"); - } - - @Override - public void init(Mod mod) { - if (new File("OneConfig/" + configFile).exists()) load(); - else save(); - } - - @Override - public void save() { - try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(Files.newOutputStream(Paths.get("OneConfig/" + configFile)), StandardCharsets.UTF_8))) { - writer.write(gson.toJson(this)); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void load() { - try (BufferedReader reader = new BufferedReader(new InputStreamReader(Files.newInputStream(Paths.get("OneConfig/" + configFile)), StandardCharsets.UTF_8))) { - deserializePart(JsonUtils.PARSER.parse(reader).getAsJsonObject(), this); - } catch (IOException e) { - e.printStackTrace(); - } + super("", "OneConfig.json"); } } |