✨ Fix annotation order
This commit is contained in:
parent
72e578ff22
commit
d6a2062069
8 changed files with 14 additions and 14 deletions
|
|
@ -49,8 +49,8 @@ public class JavacordCommand<C> implements MessageCreateListener {
|
||||||
private final cloud.commandframework.Command<C> cloudCommand;
|
private final cloud.commandframework.Command<C> cloudCommand;
|
||||||
|
|
||||||
JavacordCommand(final cloud.commandframework.@NonNull Command<C> cloudCommand,
|
JavacordCommand(final cloud.commandframework.@NonNull Command<C> cloudCommand,
|
||||||
@NonNull final CommandArgument<C, ?> command,
|
final @NonNull CommandArgument<C, ?> command,
|
||||||
@NonNull final JavacordCommandManager<C> manager) {
|
final @NonNull JavacordCommandManager<C> manager) {
|
||||||
this.command = command;
|
this.command = command;
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
this.cloudCommand = cloudCommand;
|
this.cloudCommand = cloudCommand;
|
||||||
|
|
|
||||||
|
|
@ -53,14 +53,14 @@ public class JavacordCommandManager<C> extends CommandManager<C> {
|
||||||
* @param commandPermissionMapper Function used to check if a command sender has the permission to execute a command
|
* @param commandPermissionMapper Function used to check if a command sender has the permission to execute a command
|
||||||
* @throws Exception If the construction of the manager fails
|
* @throws Exception If the construction of the manager fails
|
||||||
*/
|
*/
|
||||||
public JavacordCommandManager(@NonNull final DiscordApi discordApi,
|
public JavacordCommandManager(final @NonNull DiscordApi discordApi,
|
||||||
@NonNull final Function<@NonNull CommandTree<C>,
|
final @NonNull Function<@NonNull CommandTree<C>,
|
||||||
@NonNull CommandExecutionCoordinator<C>> commandExecutionCoordinator,
|
@NonNull CommandExecutionCoordinator<C>> commandExecutionCoordinator,
|
||||||
@NonNull final Function<@NonNull JavacordCommandSender, @NonNull C> commandSenderMapper,
|
final @NonNull Function<@NonNull JavacordCommandSender, @NonNull C> commandSenderMapper,
|
||||||
@NonNull
|
@NonNull
|
||||||
final Function<@NonNull C, @NonNull JavacordCommandSender> backwardsCommandSenderMapper,
|
final Function<@NonNull C, @NonNull JavacordCommandSender> backwardsCommandSenderMapper,
|
||||||
@NonNull final Function<@NonNull C, @NonNull String> commandPrefixMapper,
|
final @NonNull Function<@NonNull C, @NonNull String> commandPrefixMapper,
|
||||||
@NonNull final Function<@NonNull C, @NonNull Boolean> commandPermissionMapper)
|
final @NonNull Function<@NonNull C, @NonNull Boolean> commandPermissionMapper)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
super(commandExecutionCoordinator, new JavacordRegistrationHandler<>());
|
super(commandExecutionCoordinator, new JavacordRegistrationHandler<>());
|
||||||
((JavacordRegistrationHandler<C>) this.getCommandRegistrationHandler()).initialize(this);
|
((JavacordRegistrationHandler<C>) this.getCommandRegistrationHandler()).initialize(this);
|
||||||
|
|
|
||||||
|
|
@ -39,12 +39,12 @@ final class JavacordRegistrationHandler<C> implements CommandRegistrationHandler
|
||||||
JavacordRegistrationHandler() {
|
JavacordRegistrationHandler() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void initialize(@NonNull final JavacordCommandManager<C> javacordCommandManager) {
|
void initialize(final @NonNull JavacordCommandManager<C> javacordCommandManager) {
|
||||||
this.javacordCommandManager = javacordCommandManager;
|
this.javacordCommandManager = javacordCommandManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean registerCommand(@NonNull final Command<?> command) {
|
public boolean registerCommand(final @NonNull Command<?> command) {
|
||||||
/* We only care about the root command argument */
|
/* We only care about the root command argument */
|
||||||
final CommandArgument<?, ?> commandArgument = command.getArguments().get(0);
|
final CommandArgument<?, ?> commandArgument = command.getArguments().get(0);
|
||||||
if (this.registeredCommands.containsKey(commandArgument)) {
|
if (this.registeredCommands.containsKey(commandArgument)) {
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ public class JavacordCommandSender {
|
||||||
*
|
*
|
||||||
* @param event The event which triggered the command
|
* @param event The event which triggered the command
|
||||||
*/
|
*/
|
||||||
public JavacordCommandSender(@NonNull final MessageCreateEvent event) {
|
public JavacordCommandSender(final @NonNull MessageCreateEvent event) {
|
||||||
this.event = event;
|
this.event = event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ public class JavacordPrivateSender extends JavacordCommandSender {
|
||||||
*
|
*
|
||||||
* @param event The event which triggered the command
|
* @param event The event which triggered the command
|
||||||
*/
|
*/
|
||||||
public JavacordPrivateSender(@NonNull final MessageCreateEvent event) {
|
public JavacordPrivateSender(final @NonNull MessageCreateEvent event) {
|
||||||
super(event);
|
super(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ public class JavacordServerSender extends JavacordCommandSender {
|
||||||
*
|
*
|
||||||
* @param event The event which triggered the command
|
* @param event The event which triggered the command
|
||||||
*/
|
*/
|
||||||
public JavacordServerSender(@NonNull final MessageCreateEvent event) {
|
public JavacordServerSender(final @NonNull MessageCreateEvent event) {
|
||||||
super(event);
|
super(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ public final class CloudBrigadierManager<C, S> {
|
||||||
final @NonNull ArgumentParser<C, T> argument) {
|
final @NonNull ArgumentParser<C, T> argument) {
|
||||||
final Supplier<ArgumentType<?>> argumentTypeSupplier = this.defaultArgumentTypeSuppliers
|
final Supplier<ArgumentType<?>> argumentTypeSupplier = this.defaultArgumentTypeSuppliers
|
||||||
.get(GenericTypeReflector.erase(clazz.getType()));
|
.get(GenericTypeReflector.erase(clazz.getType()));
|
||||||
@Nullable final ArgumentType<?> defaultType;
|
final @Nullable ArgumentType<?> defaultType;
|
||||||
if (argumentTypeSupplier != null) {
|
if (argumentTypeSupplier != null) {
|
||||||
defaultType = argumentTypeSupplier.get();
|
defaultType = argumentTypeSupplier.get();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ public class BukkitPluginRegistrationHandler<C> implements CommandRegistrationHa
|
||||||
* @param alias Alias
|
* @param alias Alias
|
||||||
* @return {@code true} if the alias is recognized, else {@code false}
|
* @return {@code true} if the alias is recognized, else {@code false}
|
||||||
*/
|
*/
|
||||||
public boolean isRecognized(@NonNull final String alias) {
|
public boolean isRecognized(final @NonNull String alias) {
|
||||||
return this.recognizedAliases.contains(alias);
|
return this.recognizedAliases.contains(alias);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue