Skip to content

Commit a6561fc

Browse files
committed
修复无法正常检查更新的问题
1 parent 98a1d58 commit a6561fc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/com/hzzz/points/Points.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ public static Points getInstance() {
6363
*/
6464
@Override
6565
public void onLoad() {
66-
// 检查更新
67-
updateChecker();
68-
6966
// 如果配置文件不存在, 保存默认的配置
7067
// config.yml
7168
saveDefaultConfig();
@@ -107,6 +104,9 @@ public void onEnable() {
107104
// 读取配置 供初始化使用
108105
FileConfiguration config = getConfig();
109106

107+
// 检查更新
108+
updateChecker();
109+
110110
// 可能需要重写,这样不论是否关闭模块,对应模块都会实例化,大概是不能写懒汉式单例
111111
final CommandInfo[] commandInfos = { // 指令 要注册的执行器 判断是否开启的配置文件节点(为null就是直接开启) 其他的也需要满足的判断
112112
new CommandInfo("here", Here.getInstance(), "here.enable", true), // here指令

src/main/java/com/hzzz/points/utils/github_update_checker/UpdateChecker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static public Tuple4<Boolean, Boolean, String, String> check(String current_vers
3939
int response_code = obj.getIntValue("response_code", 200);
4040
if (response_code == 200) {
4141
return new Tuple4<>(true,
42-
compare(current_version.substring(1), latest_version.substring(1)) < 0,
42+
compare(current_version, latest_version.substring(1)) < 0,
4343
latest_version,
4444
obj.getString("html_url"));
4545
}

0 commit comments

Comments
 (0)