cn.nukkit.command.CommandExecutor Java Examples

The following examples show how to use cn.nukkit.command.CommandExecutor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NukkitCommandManager.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
public boolean register(CommandInfo command, Plugin plugin, CommandExecutor executor) {
    if (command == null || commandMap == null) {
        return false;
    }
    DynamicPluginCommand cmd = new DynamicPluginCommand(
            command.getAliases(),
            command.getDesc(), "/" + command.getAliases()[0] + " " + command.getUsage(),
            executor,
            plugin);
    cmd.setPermissions(command.getPermissions());
    for (String alias : command.getAliases()) {
        commandMap.register(alias, cmd);
    }
    return true;
}
 
Example #2
Source File: DynamicPluginCommand.java    From FastAsyncWorldedit with GNU General Public License v3.0 4 votes vote down vote up
public DynamicPluginCommand(String[] aliases, String desc, String usage, CommandExecutor owner, Plugin plugin) {
    super(aliases[0], desc, usage, aliases);
    this.owner = owner;
    this.plugin = plugin;
}