临时兼容旧版本更新列表...

Signed-off-by: 502647092 <jtb1@163.com>
dev
502647092 2015-12-09 12:33:23 +08:00
parent 67894d8449
commit 83d240e29d
1 changed files with 27 additions and 8 deletions

View File

@ -223,15 +223,34 @@ public class YumAPI {
* -
*/
public static void updateall(final CommandSender sender) {
final Map<String, Plugin> updatelist = UpdatePlugin.getUpdateList();
if (updatelist.size() > 0) {
for (final Entry<String, Plugin> updateplugin : UpdatePlugin.getUpdateList().entrySet()) {
updatefromyum(sender, updateplugin.getValue(), null);
try {
final Map<String, Plugin> updatelist = UpdatePlugin.getUpdateList();
if (updatelist.size() > 0) {
for (final Entry<String, Plugin> updateplugin : UpdatePlugin.getUpdateList().entrySet()) {
updatefromyum(sender, updateplugin.getValue(), null);
}
UpdatePlugin.clearList();
sender.sendMessage("§6更新: §c已下载所有需要插件的插件到 到update文件夹 重启后自动更新(或使用/yum upgrade直接升级)!");
} else {
sender.sendMessage("§6更新: §e未找到需要更新且可以用Yum处理的插件!");
}
} catch (final Exception | Error e) {
try {
final Map<Plugin, String> updatelist = UpdatePlugin.getList();
if (updatelist.size() > 0) {
for (final Entry<Plugin, String> updateplugin : UpdatePlugin.getList().entrySet()) {
updatefromyum(sender, updateplugin.getKey(), null);
}
UpdatePlugin.getList().clear();
sender.sendMessage("§6更新: §c已下载所有需要插件的插件到 到update文件夹 重启后自动更新(或使用/yum upgrade直接升级)!");
} else {
sender.sendMessage("§6更新: §e未找到需要更新且可以用Yum处理的插件!");
}
} catch (final Exception | Error e2) {
sender.sendMessage("§4错误: §c无法检索全体更新列表!");
sender.sendMessage("§4异常: §c" + e2.getMessage());
}
UpdatePlugin.clearList();
sender.sendMessage("§6更新: §c已下载所有需要插件的插件到 到update文件夹 重启后自动更新(或使用/yum upgrade直接升级)!");
} else {
sender.sendMessage("§6更新: §e未找到需要更新且可以用Yum处理的插件!");
}
}