1
0
mirror of https://e.coding.net/circlecloud/SimpleEssential.git synced 2024-11-17 01:18:47 +00:00

fix versionchecker url...

This commit is contained in:
j502647092 2015-09-01 22:47:10 +08:00
parent 0bd132f2b7
commit 64dbc4529b

View File

@ -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());
}
}
});