mirror of
https://github.com/aikar/commands.git
synced 2026-05-31 06:11:55 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user