aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/config/elements
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-08-26 16:58:59 +0200
committerGitHub <noreply@github.com>2022-08-26 16:58:59 +0200
commitbf2cf4d8166a36ed089040889ad950ad3b71bc08 (patch)
treeeb1e4a9c5db5c70be872c7924d3cc2e5ca1446c8 /src/main/java/cc/polyfrost/oneconfig/config/elements
parent8c6863a0c554ab75e8967618d6a0b90aaa4562f2 (diff)
downloadOneConfig-bf2cf4d8166a36ed089040889ad950ad3b71bc08.tar.gz
OneConfig-bf2cf4d8166a36ed089040889ad950ad3b71bc08.tar.bz2
OneConfig-bf2cf4d8166a36ed089040889ad950ad3b71bc08.zip
Finally remove stupid deserializePart method (#118)
* InstanceSupplier my beloved * Api my not so beloved * License header before moon kills me
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/config/elements')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/elements/BasicOption.java16
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/elements/OptionCategory.java6
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/elements/OptionPage.java6
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/elements/OptionSubcategory.java6
4 files changed, 1 insertions, 33 deletions
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) {
}
/**
@@ -115,20 +115,6 @@ public abstract class BasicOption {
}
/**
- * 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
*/
public boolean isEnabled() {
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<OptionSubcategory> 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);
- }
- }
}