aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/config/gson/ExclusionUtils.java
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-06-28 17:29:26 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-06-28 17:29:26 +0700
commite85b11665a92e8a6bffb11b76b45ee3c97138bd2 (patch)
tree1e85d3673d6511df53b96deb8fc23989cd304722 /src/main/java/cc/polyfrost/oneconfig/config/gson/ExclusionUtils.java
parent61861be3663dc05883c387070c81eae9154444ef (diff)
downloadOneConfig-e85b11665a92e8a6bffb11b76b45ee3c97138bd2.tar.gz
OneConfig-e85b11665a92e8a6bffb11b76b45ee3c97138bd2.tar.bz2
OneConfig-e85b11665a92e8a6bffb11b76b45ee3c97138bd2.zip
revert funny diamond hud stuff
add ExcludeType again fix INSTANCE field stuff
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/config/gson/ExclusionUtils.java')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/gson/ExclusionUtils.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/gson/ExclusionUtils.java b/src/main/java/cc/polyfrost/oneconfig/config/gson/ExclusionUtils.java
new file mode 100644
index 0000000..3981134
--- /dev/null
+++ b/src/main/java/cc/polyfrost/oneconfig/config/gson/ExclusionUtils.java
@@ -0,0 +1,15 @@
+package cc.polyfrost.oneconfig.config.gson;
+
+public class ExclusionUtils {
+ protected static boolean isSuperClassOf(Class<?> clazz, Class<?> parentClass) {
+ Class<?> tempClass = clazz;
+ Class<?> lastClass;
+ if (tempClass == parentClass) return true;
+ while (true) {
+ lastClass = tempClass;
+ tempClass = tempClass.getSuperclass();
+ if (tempClass == lastClass) return false;
+ if (tempClass == parentClass) return true;
+ }
+ }
+}