aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/config/interfaces/BasicOption.java
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-05-11 20:11:42 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-05-11 20:11:42 +0200
commit174dcbf96f4715fe52a21ca8592d5d71b6fa4a8b (patch)
tree514d5bfbf20de70822d577e5a47ec47850d6d8e7 /src/main/java/cc/polyfrost/oneconfig/config/interfaces/BasicOption.java
parent671a9bbad56f7760536058d2c364c0b9ff2f9e52 (diff)
downloadOneConfig-174dcbf96f4715fe52a21ca8592d5d71b6fa4a8b.tar.gz
OneConfig-174dcbf96f4715fe52a21ca8592d5d71b6fa4a8b.tar.bz2
OneConfig-174dcbf96f4715fe52a21ca8592d5d71b6fa4a8b.zip
disabling
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/config/interfaces/BasicOption.java')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/interfaces/BasicOption.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/interfaces/BasicOption.java b/src/main/java/cc/polyfrost/oneconfig/config/interfaces/BasicOption.java
index 38e0366..c036408 100644
--- a/src/main/java/cc/polyfrost/oneconfig/config/interfaces/BasicOption.java
+++ b/src/main/java/cc/polyfrost/oneconfig/config/interfaces/BasicOption.java
@@ -1,12 +1,14 @@
package cc.polyfrost.oneconfig.config.interfaces;
import java.lang.reflect.Field;
+import java.util.function.Supplier;
@SuppressWarnings({"unused"})
public abstract class BasicOption {
protected final Field field;
protected final String name;
public final int size;
+ private Supplier<Boolean> dependency;
/**
* Initialize option
@@ -82,4 +84,12 @@ public abstract class BasicOption {
public String getName() {
return name;
}
+
+ public void setDependency(Supplier<Boolean> supplier) {
+ this.dependency = supplier;
+ }
+
+ protected boolean isEnabled() {
+ return dependency == null || dependency.get();
+ }
}