Class Command.Executor

  • Enclosing class:
    Command

    public static class Command.Executor
    extends Object
    This class is used to help define the executor of certain command. There is some special methods used to give more details of this executor.
    • Method Detail

      • setPermission

        @NotNull
        @Deprecated
        public Command.Executor setPermission​(@NotNull
                                              net.mamoe.mirai.contact.MemberPermission permission)
        Deprecated.
        Set the executor Mirai Permission (Only if the CommandSender has the command that this executor belongs to and this executor's permissions, this executor runs)
        Parameters:
        permission - the executor Mirai Permission
        Returns:
        the Executor itself
      • setPermission

        @NotNull
        public Command.Executor setPermission​(@NotNull
                                              CommandPermission permission)
        Set the executor Mirai Permission (Only if the CommandSender has the command that this executor belongs to and this executor's permissions, this executor runs)
        Parameters:
        permission - the executor Mirai Permission
        Returns:
        the Executor itself
      • setCommandResultExecutors

        @NotNull
        public Command.Executor setCommandResultExecutors​(@NotNull
                                                          CommandResult result,
                                                          @NotNull
                                                          CommandResultExecutor executor)
        Set the executor of the special CommandResult after executing this Executor
        Parameters:
        result - the target CommandResult
        executor - the executor of the special CommandResult
        Returns:
        the Executor itself
      • setExecutorPermission

        @NotNull
        public Command.Executor setExecutorPermission​(@NotNull
                                                      java.util.function.Predicate<CommandSender> executorPermission)
        Set the executor permission check for this Executor When execute this Executor, it will check Command.executorPermission and the executorPermission
        Parameters:
        executorPermission - the executor permission check for this Executor
        Returns:
        the Executor self
      • removeExecutorPermission

        @NotNull
        public Command.Executor removeExecutorPermission()
        Remove the executor permission check for this Executor
        Returns:
        the Executor self
      • overrideExecutorPermission

        @NotNull
        public Command.Executor overrideExecutorPermission​(@NotNull
                                                           java.util.function.Predicate<CommandSender> executorPermission)
        Set the executor permission check for this Executor When execute this Executor, it will only check the executorPermission
        Parameters:
        executorPermission - the executor permission check for this Executor
        Returns:
        the Executor self
      • getCommand

        public Command getCommand()
        Get the command this Executor belongs to
        Returns:
        the command this Executor belongs to