rename to make more sense x2
This commit is contained in:
@@ -3,7 +3,7 @@ package net.tomatentum.marinara.util;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import net.tomatentum.marinara.interaction.commands.annotation.ApplicationCommand;
|
||||
import net.tomatentum.marinara.interaction.commands.annotation.SlashCommand;
|
||||
import net.tomatentum.marinara.interaction.commands.annotation.SubCommand;
|
||||
|
||||
public final class ReflectionUtil {
|
||||
@@ -22,16 +22,16 @@ public final class ReflectionUtil {
|
||||
}
|
||||
|
||||
public static void checkValidCommandMethod(Method method) {
|
||||
if (method.isAnnotationPresent(ApplicationCommand.class) &&
|
||||
method.getDeclaringClass().isAnnotationPresent(ApplicationCommand.class)) {
|
||||
if (method.isAnnotationPresent(SlashCommand.class) &&
|
||||
method.getDeclaringClass().isAnnotationPresent(SlashCommand.class)) {
|
||||
throw new RuntimeException(method.getName() + ": Can't have ApplicationCommand Annotation on Class and Method");
|
||||
}
|
||||
|
||||
if (!isAnnotationPresent(method, ApplicationCommand.class))
|
||||
if (!isAnnotationPresent(method, SlashCommand.class))
|
||||
throw new RuntimeException(method.getName() + ": Missing ApplicationCommand Annotation on either Class or Method");
|
||||
|
||||
if (!(method.isAnnotationPresent(SubCommand.class) &&
|
||||
isAnnotationPresent(method, ApplicationCommand.class))) {
|
||||
isAnnotationPresent(method, SlashCommand.class))) {
|
||||
throw new RuntimeException(method.getName() + ": Missing ApplicationCommand Annotation on either Method or Class");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user