From bf2cf4d8166a36ed089040889ad950ad3b71bc08 Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Fri, 26 Aug 2022 16:58:59 +0200 Subject: Finally remove stupid deserializePart method (#118) * InstanceSupplier my beloved * Api my not so beloved * License header before moon kills me --- .../polyfrost/oneconfig/config/elements/BasicOption.java | 16 +--------------- .../oneconfig/config/elements/OptionCategory.java | 6 ------ .../polyfrost/oneconfig/config/elements/OptionPage.java | 6 ------ .../oneconfig/config/elements/OptionSubcategory.java | 6 ------ 4 files changed, 1 insertion(+), 33 deletions(-) (limited to 'src/main/java/cc/polyfrost/oneconfig/config/elements') diff --git a/src/main/java/cc/polyfrost/oneconfig/config/elements/BasicOption.java b/src/main/java/cc/polyfrost/oneconfig/config/elements/BasicOption.java index 82d8b31..3394c52 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/elements/BasicOption.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/elements/BasicOption.java @@ -102,7 +102,7 @@ public abstract class BasicOption { * @param x x position * @param y y position */ - public void drawLast(long vg, int x, int y , InputHandler inputHandler) { + public void drawLast(long vg, int x, int y, InputHandler inputHandler) { } /** @@ -114,20 +114,6 @@ public abstract class BasicOption { public void keyTyped(char key, int keyCode) { } - /** - * Reset the field to its default value - * - * @param config The config the field is in - */ - public void reset(Config config) { - Object object = config.getDefault(field); - if (object == null) return; - try { - set(object); - } catch (IllegalAccessException ignored) { - } - } - /** * @return If the option is enabled, based on the dependencies */ diff --git a/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionCategory.java b/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionCategory.java index d3da143..4daefca 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionCategory.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionCategory.java @@ -32,10 +32,4 @@ import java.util.ArrayList; public class OptionCategory { public final ArrayList subcategories = new ArrayList<>(); - - public void reset(Config config) { - for (OptionSubcategory subcategory : subcategories) { - subcategory.reset(config); - } - } } diff --git a/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionPage.java b/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionPage.java index 9ac7c14..7a1dfb0 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionPage.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionPage.java @@ -40,10 +40,4 @@ public class OptionPage { this.name = name; this.mod = mod; } - - public void reset(Config config) { - for (OptionCategory subcategory : categories.values()) { - subcategory.reset(config); - } - } } diff --git a/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionSubcategory.java b/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionSubcategory.java index 282f30f..08c59b8 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionSubcategory.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionSubcategory.java @@ -132,10 +132,4 @@ public class OptionSubcategory { public String getName() { return name; } - - public void reset(Config config) { - for (BasicOption option : options) { - options.remove(config); - } - } } -- cgit