Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Commit

Permalink
Changes -> Improved version check
Browse files Browse the repository at this point in the history
  • Loading branch information
EinfacheSache committed Sep 3, 2023
1 parent 55d3a8a commit 49003e0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<dependency>
<groupId>com.github.CubeAttack</groupId>
<artifactId>EasyAPI</artifactId>
<version>be2e56a323</version>
<version>d07005b75d</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/de/cubeattack/neoprotect/core/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public Core(NeoProtectPlugin plugin) {

this.plugin = plugin;
this.isJPremiumInstalled = plugin.getPlugins().contains("JPremium");
this.versionResult = VersionUtils.checkVersion("NeoProtect", "NeoPlugin", "v" + plugin.getPluginVersion(), VersionUtils.UpdateSetting.ENABLED, 10, result -> versionResult = result).message();
this.versionResult = VersionUtils.checkVersion("NeoProtect", "NeoPlugin", "v" + plugin.getPluginVersion(), VersionUtils.UpdateSetting.DISABLED).message();

FileUtils config = new FileUtils(Core.class.getResourceAsStream("/config.yml"), "plugins/NeoProtect", "config.yml", false);
FileUtils languageEN = new FileUtils(Core.class.getResourceAsStream("/language_en.properties"), "plugins/NeoProtect/languages", "language_en.properties", true);
Expand All @@ -53,9 +53,10 @@ public Core(NeoProtectPlugin plugin) {

Config.loadConfig(this, config);

this.restAPIRequests = new RestAPIRequests(this);
this.localization = new Localization("language", Locale.forLanguageTag(Config.getLanguage()), new File("plugins/NeoProtect/languages/"));

restAPIRequests = new RestAPIRequests(this);
VersionUtils.updateToLatestVersion(versionResult, Config.getAutoUpdaterSettings(), 10, result -> versionResult = result);
}

public void debug(String output) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ private void versionCheckSchedule() {
new Timer().schedule(new TimerTask() {
@Override
public void run() {
core.setVersionResult(VersionUtils.checkVersion("NeoProtect", "NeoPlugin", "v" + core.getPlugin().getPluginVersion(), Config.getAutoUpdaterSettings(), 0, null));
core.setVersionResult(VersionUtils.checkVersion("NeoProtect", "NeoPlugin", "v" + core.getPlugin().getPluginVersion(), Config.getAutoUpdaterSettings()));
}
}, 1000 * 60 * 5, 1000 * 60 * 5);
}, 1000 * 60 * 6, 1000 * 60 * 6);
}

private void attackCheckSchedule() {
Expand Down

0 comments on commit 49003e0

Please sign in to comment.