From 64dbc4529bcc435882f7d627b8bfdba95b140ddc Mon Sep 17 00:00:00 2001 From: j502647092 Date: Tue, 1 Sep 2015 22:47:10 +0800 Subject: [PATCH] fix versionchecker url... --- .../SimpleEssential/utils/VersionChecker.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/cn/citycraft/SimpleEssential/utils/VersionChecker.java b/src/main/java/cn/citycraft/SimpleEssential/utils/VersionChecker.java index 6aebcbb..1c1b82a 100644 --- a/src/main/java/cn/citycraft/SimpleEssential/utils/VersionChecker.java +++ b/src/main/java/cn/citycraft/SimpleEssential/utils/VersionChecker.java @@ -1,7 +1,6 @@ package cn.citycraft.SimpleEssential.utils; import java.io.BufferedReader; -import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; @@ -20,12 +19,11 @@ import com.google.common.base.Charsets; /** * 自动更新类 * - * @author 蒋天蓓 - * 2015年8月14日下午4:01:15 + * @author 蒋天蓓 2015年8月14日下午4:01:15 */ public class VersionChecker implements Listener { Plugin plugin; - public String checkurl = "https://coding.net/u/502647092/p/%s/git/raw/%s/src/plugin.yml"; + public String checkurl = "https://coding.net/u/502647092/p/%s/git/raw/%s/src/main/resources/plugin.yml"; public String branch = "master"; /** @@ -91,19 +89,17 @@ public class VersionChecker implements Listener { String newVersion = config.getString("version"); br.close(); if (!newVersion.equals(currentVersion)) { - String[] msg = new String[] { - ChatColor.GREEN + plugin.getName() + " 插件最新版本 v" + newVersion, + String[] msg = new String[] { ChatColor.GREEN + plugin.getName() + " 插件最新版本 v" + newVersion, ChatColor.RED + "服务器运行版本: v" + currentVersion, - ChatColor.GOLD + "插件更新网站: " + ChatColor.BLUE + plugin.getDescription().getWebsite() - }; + ChatColor.GOLD + "插件更新网站: " + ChatColor.BLUE + plugin.getDescription().getWebsite() }; if (player != null) { player.sendMessage(msg); } else { plugin.getServer().getConsoleSender().sendMessage(msg); } } - } catch (IOException e) { - plugin.getLogger().warning("版本更新检查失败!"); + } catch (Exception e) { + plugin.getLogger().warning("版本更新检查失败 异常: " + e.getMessage()); } } });