fix upgrade command...

This commit is contained in:
j502647092 2015-09-07 00:05:13 +08:00
parent ce1dab38cc
commit d42f635dfc

View File

@ -27,18 +27,19 @@ public class CommandUpgrade extends BaseCommand {
@Override
public void execute(final CommandSender sender, String label, final String[] args) throws CommandException {
final String pluginname = args[0];
final Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin(pluginname);
sender.sendMessage("§a开始升级插件: " + pluginname);
if (plugin != null)
Bukkit.getScheduler().runTaskAsynchronously(main, () -> {
if (args.length == 1)
Bukkit.getScheduler().runTaskAsynchronously(main, () -> {
if (args.length == 0)
YumManager.plugman.upgrade(sender);
else {
String pluginname = args[0];
Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin(pluginname);
sender.sendMessage("§a开始升级插件: " + pluginname);
if (plugin != null)
YumManager.plugman.upgrade(sender, plugin);
else
YumManager.plugman.upgrade(sender);
});
else
sender.sendMessage("§c插件未安装或已卸载 需要安装请使用yum install " + pluginname + "!");
sender.sendMessage("§c插件未安装或已卸载 需要安装请使用yum install " + pluginname + "!");
}
});
};
@Override