Class BukkitCommandFactory

    • Method Detail

      • register

        public static void register​(@NotNull
                                    @NotNull PluginCommand target,
                                    @NotNull
                                    @NotNull Command command)
        Registers the command.
        Parameters:
        target - the PluginCommand
        command - the command to register
      • registerIfExists

        public static void registerIfExists​(@NotNull
                                            @NotNull JavaPlugin sourcePlugin,
                                            @NotNull
                                            @NotNull Command command)
        Searches for PluginCommand that is named as Command.getName() and register the command if it exists.
        Parameters:
        sourcePlugin - the plugin to search for the command
        command - the command to register
      • registerAsync

        public static void registerAsync​(@NotNull
                                         @NotNull PluginCommand target,
                                         @NotNull
                                         @NotNull Command command)
        Registers the command.

        If you register a command with this method, it will be executed asynchronously.

        Note:

        The tab completion will execute on main thread.

        Parameters:
        target - the PluginCommand
        command - the command to register
      • registerAsync

        public static void registerAsync​(@NotNull
                                         @NotNull PluginCommand target,
                                         @NotNull
                                         @NotNull Command command,
                                         @NotNull
                                         @NotNull Executor executor)
        Registers the command.

        If you register a command with this method, it will be executed asynchronously.

        Note:

        The tab completion will execute on main thread.

        Parameters:
        target - the PluginCommand
        command - the command to register
        executor - the executor to run command