From f893e37c97655a3cd819cb49bc55b04da912d2ed Mon Sep 17 00:00:00 2001 From: JOO200 Date: Fri, 22 Feb 2019 01:14:58 +0100 Subject: [PATCH] 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 ;) --- core/src/main/java/co/aikar/commands/RegisteredCommand.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/main/java/co/aikar/commands/RegisteredCommand.java b/core/src/main/java/co/aikar/commands/RegisteredCommand.java index 655f93de..33de4923 100644 --- a/core/src/main/java/co/aikar/commands/RegisteredCommand.java +++ b/core/src/main/java/co/aikar/commands/RegisteredCommand.java @@ -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 cmd) { this.registeredSubcommands.addAll(cmd); } + + public T getAnnotation(Class annotation) { + return method.getAnnotation(annotation); + } }