Skip to content

Commit

Permalink
新增检查更新配置开关
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdeZhang committed Apr 7, 2024
1 parent ee7a2e7 commit 3725a79
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>cn.lunadeer</groupId>
<artifactId>Dominion</artifactId>
<version>1.16.3-beta</version>
<version>1.16.4-beta</version>
<packaging>jar</packaging>

<name>Dominion</name>
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/cn/lunadeer/dominion/Dominion.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ public void onEnable() {
Objects.requireNonNull(Bukkit.getPluginCommand("dominion")).setExecutor(new Commands());

Metrics metrics = new Metrics(this, 21445);
GiteaReleaseCheck giteaReleaseCheck = new GiteaReleaseCheck(this,
"https://ssl.lunadeer.cn:14446",
"zhangyuheng",
"Dominion");
GiteaReleaseCheck giteaReleaseCheck = null;
if (config.getCheckUpdate()) {
giteaReleaseCheck = new GiteaReleaseCheck(this,
"https://ssl.lunadeer.cn:14446",
"zhangyuheng",
"Dominion");
}

XLogger.info("领地插件已启动");
XLogger.info("版本:" + this.getPluginMeta().getVersion());
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/cn/lunadeer/dominion/utils/ConfigManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public void reload() {
_limit_amount = _file.getInt("Limit.Amount", 10);
_limit_depth = _file.getInt("Limit.Depth", 10);
_world_black_list = _file.getStringList("WorldBlackList");
_check_update = _file.getBoolean("CheckUpdate", true);
}

public Boolean isDebug() {
Expand Down Expand Up @@ -222,6 +223,10 @@ public List<String> getWorldBlackList() {
return _world_black_list;
}

public Boolean getCheckUpdate() {
return _check_update;
}


private final Dominion _plugin;
private FileConfiguration _file;
Expand All @@ -247,4 +252,5 @@ public List<String> getWorldBlackList() {
private Integer _limit_amount;
private Integer _limit_depth;
private List<String> _world_black_list;
private Boolean _check_update;
}
2 changes: 2 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ AutoCleanAfterDays: 180

BlueMap: true

CheckUpdate: true

Debug: false

0 comments on commit 3725a79

Please sign in to comment.