Allow certain commands to bypass queuing

This commit is contained in:
Jesse Boyd
2018-08-24 19:33:52 +10:00
parent c3db5c0cf1
commit a61c856adc
12 changed files with 81 additions and 67 deletions

View File

@ -28,6 +28,9 @@ public abstract class AParametricCallable implements CommandCallable {
public abstract ParametricBuilder getBuilder();
public abstract boolean anyFlags();
public abstract Command getCommand();
public Command getDefinition() {
return getCommand();
}
public abstract String getGroup();
@Override
public abstract String toString();

View File

@ -60,6 +60,7 @@ public class ParametricCallable extends AParametricCallable {
private final Set<Character> legacyFlags = new HashSet<Character>();
private final SimpleDescription description = new SimpleDescription();
private final CommandPermissions commandPermissions;
private final Command definition;
/**
* Create a new instance.
@ -179,6 +180,7 @@ public class ParametricCallable extends AParametricCallable {
// Get permissions annotation
commandPermissions = method.getAnnotation(CommandPermissions.class);
this.definition = definition;
}
@Override
@ -186,6 +188,11 @@ public class ParametricCallable extends AParametricCallable {
return object.getClass().getAnnotation(Command.class);
}
@Override
public Command getDefinition() {
return definition;
}
@Override
public String getGroup() {
return object.getClass().getSimpleName().replaceAll("Commands", "").replaceAll("Util$", "");