mirror of https://e.coding.net/circlecloud/Yum.git
45 lines
1.4 KiB
Java
45 lines
1.4 KiB
Java
package pw.yumc.Yum.commands;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import pw.yumc.Yum.api.YumAPI;
|
|
import pw.yumc.YumCore.commands.annotation.Tab;
|
|
import pw.yumc.YumCore.commands.interfaces.Executor;
|
|
|
|
/**
|
|
* @author 喵♂呜
|
|
* @since 2016年7月7日 上午8:36:47
|
|
*/
|
|
public class PluginTabComplete implements Executor {
|
|
public static PluginTabComplete INSTANCE = new PluginTabComplete();
|
|
|
|
@Tab
|
|
public List<String> listTab(CommandSender sender, String label, String[] args) {
|
|
if (args.length > 0) {
|
|
switch (args[0]) {
|
|
case "install":
|
|
case "i":
|
|
return YumAPI.getRepo().getAllPluginName();
|
|
case "repo":
|
|
case "r":
|
|
if (args.length == 2) {
|
|
return Arrays.asList("add", "all", "list", "delall", "clean", "update", "del");
|
|
}
|
|
if (args.length == 3) {
|
|
return new ArrayList<>(YumAPI.getRepo().getRepos().keySet());
|
|
}
|
|
break;
|
|
case "bukkitrepo":
|
|
case "br":
|
|
return Arrays.asList("look", "install");
|
|
default:
|
|
}
|
|
}
|
|
return YumAPI.getPlugman().getPluginNames(false);
|
|
}
|
|
}
|