Add incorrect annotation fix (#46)

This commit is contained in:
cookiedragon234 2019-10-30 01:25:50 +00:00 committed by Bella
parent d025dd44d5
commit 083e93546b
1 changed files with 5 additions and 2 deletions

View File

@ -40,8 +40,11 @@ public class Module {
registerAll(bind, enabled);
}
private Info getAnnotation() { // this is 3 sprint bug
return getClass().isAnnotationPresent(Info.class) ? getClass().getAnnotation(Info.class) : Sprint.class.getAnnotation(Info.class); // dummy annotation
private Info getAnnotation() {
if (getClass().isAnnotationPresent(Info.class)) {
return getClass().getAnnotation(Info.class);
}
throw new IllegalStateException("No Annotation on class " + this.getClass().getCanonicalName() + "!");
}
public void onUpdate() {}