mirror of
https://e.coding.net/circlecloud/SimpleEssential.git
synced 2025-01-06 12:18:56 +00:00
fix versionchecker url...
This commit is contained in:
parent
0bd132f2b7
commit
64dbc4529b
@ -1,7 +1,6 @@
|
|||||||
package cn.citycraft.SimpleEssential.utils;
|
package cn.citycraft.SimpleEssential.utils;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
@ -20,12 +19,11 @@ import com.google.common.base.Charsets;
|
|||||||
/**
|
/**
|
||||||
* 自动更新类
|
* 自动更新类
|
||||||
*
|
*
|
||||||
* @author 蒋天蓓
|
* @author 蒋天蓓 2015年8月14日下午4:01:15
|
||||||
* 2015年8月14日下午4:01:15
|
|
||||||
*/
|
*/
|
||||||
public class VersionChecker implements Listener {
|
public class VersionChecker implements Listener {
|
||||||
Plugin plugin;
|
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";
|
public String branch = "master";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -91,19 +89,17 @@ public class VersionChecker implements Listener {
|
|||||||
String newVersion = config.getString("version");
|
String newVersion = config.getString("version");
|
||||||
br.close();
|
br.close();
|
||||||
if (!newVersion.equals(currentVersion)) {
|
if (!newVersion.equals(currentVersion)) {
|
||||||
String[] msg = new String[] {
|
String[] msg = new String[] { ChatColor.GREEN + plugin.getName() + " 插件最新版本 v" + newVersion,
|
||||||
ChatColor.GREEN + plugin.getName() + " 插件最新版本 v" + newVersion,
|
|
||||||
ChatColor.RED + "服务器运行版本: v" + currentVersion,
|
ChatColor.RED + "服务器运行版本: v" + currentVersion,
|
||||||
ChatColor.GOLD + "插件更新网站: " + ChatColor.BLUE + plugin.getDescription().getWebsite()
|
ChatColor.GOLD + "插件更新网站: " + ChatColor.BLUE + plugin.getDescription().getWebsite() };
|
||||||
};
|
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.sendMessage(msg);
|
player.sendMessage(msg);
|
||||||
} else {
|
} else {
|
||||||
plugin.getServer().getConsoleSender().sendMessage(msg);
|
plugin.getServer().getConsoleSender().sendMessage(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (Exception e) {
|
||||||
plugin.getLogger().warning("版本更新检查失败!");
|
plugin.getLogger().warning("版本更新检查失败 异常: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user