mirror of
https://e.coding.net/circlecloud/Yum.git
synced 2024-11-22 06:18:46 +00:00
comeplete tabcomplete and update version...
Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
parent
bf2a870984
commit
597d1337f1
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>cn.citycraft</groupId>
|
||||
<artifactId>Yum</artifactId>
|
||||
<version>1.5</version>
|
||||
<version>1.6</version>
|
||||
<name>Yum</name>
|
||||
<description>Minecraft 服务器插件管理系统</description>
|
||||
<build>
|
||||
|
@ -3,6 +3,9 @@
|
||||
*/
|
||||
package cn.citycraft.Yum.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandException;
|
||||
@ -52,5 +55,13 @@ public class CommandInfo extends BaseCommand {
|
||||
} else {
|
||||
sender.sendMessage("§4错误: §c插件 " + pluginname + " 不存在或已卸载!");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(final CommandSender sender, final Command command, final String label, final String[] args) {
|
||||
if (!args[0].equalsIgnoreCase("install") && !args[0].equalsIgnoreCase("repo")) {
|
||||
return StringUtil.copyPartialMatches(args[1], YumManager.plugman.getPluginNames(false), new ArrayList<String>());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,9 @@
|
||||
*/
|
||||
package cn.citycraft.Yum.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandException;
|
||||
@ -10,6 +13,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import cn.citycraft.PluginHelper.commands.BaseCommand;
|
||||
import cn.citycraft.PluginHelper.utils.StringUtil;
|
||||
import cn.citycraft.Yum.Yum;
|
||||
import cn.citycraft.Yum.manager.YumManager;
|
||||
|
||||
@ -51,4 +55,12 @@ public class CommandInstall extends BaseCommand {
|
||||
sender.sendMessage("§c插件" + pluginname + "已安装在服务器 需要更新请使用yum update " + pluginname + "!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(final CommandSender sender, final Command command, final String label, final String[] args) {
|
||||
if (args[0].equalsIgnoreCase("install")) {
|
||||
return StringUtil.copyPartialMatches(args[1], YumManager.repo.getAllPluginName(), new ArrayList<String>());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,10 @@
|
||||
*/
|
||||
package cn.citycraft.Yum.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandException;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -59,5 +63,13 @@ public class CommandRepo extends BaseCommand {
|
||||
sender.sendMessage("§6仓库: §a仓库缓存数据已更新!");
|
||||
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 null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user