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

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2015-12-09 12:33:23 +08:00
parent 67894d8449
commit 83d240e29d

View File

@ -223,6 +223,8 @@ public class YumAPI {
* - 命令发送者 * - 命令发送者
*/ */
public static void updateall(final CommandSender sender) { public static void updateall(final CommandSender sender) {
try {
final Map<String, Plugin> updatelist = UpdatePlugin.getUpdateList(); final Map<String, Plugin> updatelist = UpdatePlugin.getUpdateList();
if (updatelist.size() > 0) { if (updatelist.size() > 0) {
for (final Entry<String, Plugin> updateplugin : UpdatePlugin.getUpdateList().entrySet()) { for (final Entry<String, Plugin> updateplugin : UpdatePlugin.getUpdateList().entrySet()) {
@ -233,6 +235,23 @@ public class YumAPI {
} else { } else {
sender.sendMessage("§6更新: §e未找到需要更新且可以用Yum处理的插件!"); 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());
}
}
} }
/** /**