Added OP Player JoinEvent nofication when update available
This commit is contained in:
1 parent
6c19c18523
commit
4ee6495006
3 files changed
+93
-3
No files matched your search
@@ -11,6 +11,8 @@ public class GitHubUpdateChecker {
|
||||
|
||||
private final JavaPlugin plugin;
|
||||
private final String pomUrl;
|
||||
private volatile boolean updateAvailable = false;
|
||||
private volatile String latestVersion = null;
|
||||
|
||||
private static final String POM_URL =
|
||||
"https://raw.githubusercontent.com/RS-Scripting/RS-ServerAdmin/main/pom.xml";
|
||||
@@ -55,12 +57,19 @@ public class GitHubUpdateChecker {
|
||||
latestVersion
|
||||
)) {
|
||||
|
||||
updateAvailable = false;
|
||||
|
||||
plugin.getLogger().info(
|
||||
"RS-ServerAdmin is up to date."
|
||||
);
|
||||
|
||||
} else {
|
||||
|
||||
updateAvailable = true;
|
||||
|
||||
this.latestVersion =
|
||||
latestVersion;
|
||||
|
||||
plugin.getLogger().warning(
|
||||
"Update available! Current: "
|
||||
+ currentVersion
|
||||
@@ -118,4 +127,16 @@ public class GitHubUpdateChecker {
|
||||
|
||||
}
|
||||
|
||||
public boolean isUpdateAvailable() {
|
||||
|
||||
return updateAvailable;
|
||||
|
||||
}
|
||||
|
||||
public String getLatestVersionFound() {
|
||||
|
||||
return latestVersion;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user