Fix: Multiple Sprint Modules

Backpoort of cookiedragon234s fix: https://github.com/S-B99/KAMI/pull/46
This commit is contained in:
blockparole 2019-11-03 22:21:16 +01:00
parent 8542f87f37
commit 66bf207b6a
1 changed files with 5 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import java.util.List;
/**
* Created by 086 on 23/08/2017.
* Updated by hub on 3 November 2019
*/
public class Module {
@ -41,7 +42,10 @@ public class Module {
}
private Info getAnnotation() {
return getClass().isAnnotationPresent(Info.class) ? getClass().getAnnotation(Info.class) : Sprint.class.getAnnotation(Info.class); // dummy annotation
if (getClass().isAnnotationPresent(Info.class)) {
return getClass().getAnnotation(Info.class);
}
throw new IllegalStateException("No Annotation on class " + this.getClass().getCanonicalName() + "!");
}
public void onUpdate() {}