Skip to content

Commit

Permalink
Fixed keys not being set to @command annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
BreadMoirai committed Nov 29, 2017
1 parent 139d51a commit 8eaf8c8
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ public class DefaultCommandProperties {
private static final Pattern COMMAND_PATTERN = Pattern.compile(".+(command|cmd)(s)?");

public void initialize(CommandPropertiesManagerImpl cp) {
cp.putCommandModifier(Command.class, (p, builder) -> {
if (p.value().length != 0) builder.setKeys(p.value());
});
cp.putCommandModifier(MainCommand.class, (p, builder) -> {
if (p.value().length != 0) builder.setKeys(p.value());
});
cp.putCommandModifier(Name.class, (p, builder) -> builder.setName(p.value()));
cp.putCommandModifier(Group.class, (p, builder) -> builder.setGroup(p.value()));
cp.putCommandModifier(Description.class, (p, builder) -> builder.setDescription(p.value()));
Expand All @@ -38,7 +44,6 @@ public void initialize(CommandPropertiesManagerImpl cp) {
builder.setSplitRegex(p.regex(), p.limit());
});


cp.putCommandModifier(null, (o, builder) -> {
Class<?> declaringClass = builder.getDeclaringClass();
if (Consumer.class.isAssignableFrom(declaringClass)) {
Expand Down

0 comments on commit 8eaf8c8

Please sign in to comment.