9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-22 16:49:14 +00:00

Schema hell

This commit is contained in:
cyberpwn
2021-08-30 08:09:48 -04:00
parent fbdb060e10
commit 801c44389e
5 changed files with 118 additions and 5 deletions

View File

@@ -202,6 +202,23 @@ public class Iris extends VolmitPlugin implements Listener {
return v;
}
public static KList<Class<?>> getClasses(String s, Class<? extends Annotation> slicedClass) {
JarScanner js = new JarScanner(instance.getJarFile(), s);
KList<Class<?>> v = new KList<>();
J.attempt(js::scan);
for (Class<?> i : js.getClasses()) {
if (slicedClass == null || i.isAnnotationPresent(slicedClass)) {
try {
v.add(i);
} catch (Throwable ignored) {
}
}
}
return v;
}
public static KList<Object> initialize(String s) {
return initialize(s, null);
}