aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-27 12:28:34 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-27 12:28:34 +0200
commitf357d02e9b850edbf7a20b05e2328438cf0208f8 (patch)
tree4e70a787a5bd8ba1c4d28e56a171831d20b79247 /src/main/java/cc/polyfrost
parent08f953aa649759f4975f176eb15932a0cd11e3ec (diff)
parent23422ac23d158db89b67aefa1a5e5b1ad1367a68 (diff)
downloadOneConfig-f357d02e9b850edbf7a20b05e2328438cf0208f8.tar.gz
OneConfig-f357d02e9b850edbf7a20b05e2328438cf0208f8.tar.bz2
OneConfig-f357d02e9b850edbf7a20b05e2328438cf0208f8.zip
Merge branch 'master' of github.com:Polyfrost/OneConfig
Diffstat (limited to 'src/main/java/cc/polyfrost')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/Config.java4
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/annotations/Exclude.java2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/Config.java b/src/main/java/cc/polyfrost/oneconfig/config/Config.java
index 6ef9494..4228277 100644
--- a/src/main/java/cc/polyfrost/oneconfig/config/Config.java
+++ b/src/main/java/cc/polyfrost/oneconfig/config/Config.java
@@ -262,6 +262,10 @@ public class Config {
*/
@Override
public boolean shouldSkipClass(Class<?> clazz) {
+ Exclude annotation = clazz.getAnnotation(Exclude.class);
+ if (annotation != null) {
+ return annotation.type() != Exclude.ExcludeType.HUD;
+ }
return false;
}
}
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 6ffd1d9..eddb490 100644
--- a/src/main/java/cc/polyfrost/oneconfig/config/annotations/Exclude.java
+++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Exclude.java
@@ -12,7 +12,7 @@ import java.lang.annotation.Target;
* This can be used interchangeably with the transient modifier built into Java.
*/
@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
+@Target({ElementType.FIELD, ElementType.TYPE})
public @interface Exclude {
ExcludeType type() default ExcludeType.ALL;