run repo command async...

Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
j502647092 2015-10-02 21:26:47 +08:00
parent 0f3aa5f0de
commit f1b5551cf2
2 changed files with 37 additions and 28 deletions

View File

@ -64,8 +64,8 @@
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>citycraft-repo</id>
<url>http://ci.citycraft.cn:8800/jenkins/plugin/repository/everything/</url>
<id>sumcraft-repo</id>
<url>http://ci.sumcraft.net:8080/plugin/repository/everything/</url>
</repository>
<repository>
<id>Plugin Metrics</id>
@ -77,7 +77,7 @@
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<type>jar</type>
<version>1.8.3-R0.1-SNAPSHOT</version>
<version>1.8.8-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.citycraft</groupId>

View File

@ -37,6 +37,9 @@ public class CommandRepo extends BaseCommand {
@Override
public void execute(final CommandSender sender, final Command command, final String label, final String[] args) throws CommandException {
main.getServer().getScheduler().runTaskAsynchronously(main, new Runnable() {
@Override
public void run() {
final String cmd = args[0];
switch (cmd) {
case "add":
@ -64,11 +67,17 @@ public class CommandRepo extends BaseCommand {
break;
}
}
});
}
@Override
public List<String> onTabComplete(final CommandSender sender, final Command command, final String label, final String[] args) {
if (args[0].equalsIgnoreCase("repo")) {
return StringUtil.copyPartialMatches(args[1], Arrays.asList(new String[] { "add", "list", "clean", "update" }), new ArrayList<String>());
return StringUtil.copyPartialMatches(args[1], Arrays.asList(new String[] { "add",
"list",
"clean",
"update" }),
new ArrayList<String>());
}
return null;
}