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