Skip to content

Commit 5cb4430

Browse files
committed
Fix detection of repeated Option and Flag annotations
1 parent 6be9d00 commit 5cb4430

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/dev/despical/commandframework/CommandHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull org.bukkit.comm
122122
return true;
123123
}
124124

125-
boolean parseOptions = method.isAnnotationPresent(Option.class) || method.isAnnotationPresent(Flag.class);
125+
boolean parseOptions = method.getAnnotationsByType(Option.class).length > 0 ||
126+
method.getAnnotationsByType(Flag.class).length > 0;
126127

127128
if (parseOptions) {
128129
OptionParser optionParser = new OptionParser(newArgs, method);

0 commit comments

Comments
 (0)