Added Method-Getter in RegisteredCommand class (#193)

I want to use own annotations for help implementations (link, tooltips, short description etc.)
I can't access the method directly for the annotations, please add the getter ;)
This commit is contained in:
JOO200
2019-02-22 01:14:58 +01:00
committed by Daniel Ennis
parent 59b4392de1
commit f893e37c97
@@ -34,6 +34,7 @@ import co.aikar.commands.annotation.Syntax;
import co.aikar.commands.contexts.ContextResolver;
import org.jetbrains.annotations.Nullable;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
@@ -331,4 +332,8 @@ public class RegisteredCommand<CEC extends CommandExecutionContext<CEC, ? extend
public void addSubcommands(Collection<String> cmd) {
this.registeredSubcommands.addAll(cmd);
}
public <T extends Annotation> T getAnnotation(Class<T> annotation) {
return method.getAnnotation(annotation);
}
}