aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-06-28 18:06:27 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-06-28 18:06:27 +0700
commit324af98fa58a44ea64b3f841e6f73b827e80922d (patch)
treebde7bfab927b92fb1c1da5bf19d78740fae3aeb2
parente4922cc5f965b5d1c467d1cc310ad06629b5863a (diff)
downloadOneConfig-324af98fa58a44ea64b3f841e6f73b827e80922d.tar.gz
OneConfig-324af98fa58a44ea64b3f841e6f73b827e80922d.tar.bz2
OneConfig-324af98fa58a44ea64b3f841e6f73b827e80922d.zip
I am Not About To Jump Off A Bridge !!!!
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/annotations/Exclude.java7
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/core/ConfigUtils.java2
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/gson/NonProfileSpecificExclusionStrategy.java4
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/gson/ProfileExclusionStrategy.java4
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/hud/MultiTextHud.java2
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/hud/SingleTextHud.java3
6 files changed, 7 insertions, 15 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/Exclude.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Exclude.java
index eddb490..8736e56 100644
--- a/src/main/java/cc/polyfrost/oneconfig/config/annotations/Exclude.java
+++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Exclude.java
@@ -14,11 +14,4 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE})
public @interface Exclude {
- ExcludeType type() default ExcludeType.ALL;
-
- enum ExcludeType {
- ALL,
- CONFIG,
- HUD
- }
}
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/core/ConfigUtils.java b/src/main/java/cc/polyfrost/oneconfig/config/core/ConfigUtils.java
index 14e8d01..50fb3e6 100644
--- a/src/main/java/cc/polyfrost/oneconfig/config/core/ConfigUtils.java
+++ b/src/main/java/cc/polyfrost/oneconfig/config/core/ConfigUtils.java
@@ -58,7 +58,7 @@ public class ConfigUtils {
}
for (Field field : fields) {
Exclude exclude = findAnnotation(field, Exclude.class);
- if (exclude != null && exclude.type() != Exclude.ExcludeType.CONFIG) continue;
+ if (exclude != null) continue;
Option option = findAnnotation(field, Option.class);
if (option == null) continue;
options.add(getOption(option, field, object));
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/gson/NonProfileSpecificExclusionStrategy.java b/src/main/java/cc/polyfrost/oneconfig/config/gson/NonProfileSpecificExclusionStrategy.java
index 7679b9c..e773295 100644
--- a/src/main/java/cc/polyfrost/oneconfig/config/gson/NonProfileSpecificExclusionStrategy.java
+++ b/src/main/java/cc/polyfrost/oneconfig/config/gson/NonProfileSpecificExclusionStrategy.java
@@ -16,7 +16,7 @@ public class NonProfileSpecificExclusionStrategy extends ExclusionUtils implemen
if (isSuperClassOf(f.getDeclaredClass(), Config.class)) return true;
if (f.getAnnotation(NonProfileSpecific.class) == null) return true;
Exclude exclude = f.getAnnotation(Exclude.class);
- return exclude != null && exclude.type() != Exclude.ExcludeType.HUD;
+ return exclude != null;
}
/**
@@ -26,6 +26,6 @@ public class NonProfileSpecificExclusionStrategy extends ExclusionUtils implemen
@Override
public boolean shouldSkipClass(Class<?> clazz) {
Exclude exclude = clazz.getAnnotation(Exclude.class);
- return exclude != null && exclude.type() != Exclude.ExcludeType.HUD;
+ return exclude != null;
}
}
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/gson/ProfileExclusionStrategy.java b/src/main/java/cc/polyfrost/oneconfig/config/gson/ProfileExclusionStrategy.java
index 45f3a04..ad9722b 100644
--- a/src/main/java/cc/polyfrost/oneconfig/config/gson/ProfileExclusionStrategy.java
+++ b/src/main/java/cc/polyfrost/oneconfig/config/gson/ProfileExclusionStrategy.java
@@ -16,7 +16,7 @@ public class ProfileExclusionStrategy extends ExclusionUtils implements Exclusio
if (isSuperClassOf(f.getDeclaredClass(), Config.class)) return true;
if (f.getAnnotation(NonProfileSpecific.class) != null) return true;
Exclude exclude = f.getAnnotation(Exclude.class);
- return exclude != null && exclude.type() != Exclude.ExcludeType.HUD;
+ return exclude != null;
}
/**
@@ -26,6 +26,6 @@ public class ProfileExclusionStrategy extends ExclusionUtils implements Exclusio
@Override
public boolean shouldSkipClass(Class<?> clazz) {
Exclude exclude = clazz.getAnnotation(Exclude.class);
- return exclude != null && exclude.type() != Exclude.ExcludeType.HUD;
+ return exclude != null;
}
}
diff --git a/src/main/java/cc/polyfrost/oneconfig/hud/MultiTextHud.java b/src/main/java/cc/polyfrost/oneconfig/hud/MultiTextHud.java
index 17e27ec..44bf789 100644
--- a/src/main/java/cc/polyfrost/oneconfig/hud/MultiTextHud.java
+++ b/src/main/java/cc/polyfrost/oneconfig/hud/MultiTextHud.java
@@ -50,7 +50,7 @@ public abstract class MultiTextHud extends TextHud implements Conditional {
}
}
- @Exclude(type = Exclude.ExcludeType.HUD)
+ @Exclude
public boolean cacheText = true;
@Override
diff --git a/src/main/java/cc/polyfrost/oneconfig/hud/SingleTextHud.java b/src/main/java/cc/polyfrost/oneconfig/hud/SingleTextHud.java
index d0898ed..94bb496 100644
--- a/src/main/java/cc/polyfrost/oneconfig/hud/SingleTextHud.java
+++ b/src/main/java/cc/polyfrost/oneconfig/hud/SingleTextHud.java
@@ -56,8 +56,7 @@ public abstract class SingleTextHud extends TextHud implements Conditional {
}
}
- @Switch(name = "Cache Text")
- @Exclude(type = Exclude.ExcludeType.HUD)
+ @Exclude
public boolean cacheText = true;
@Switch(