feat: (Re-) Add update notifications (#1361)

* feat: (Re-) Add update notifications

Fixes #1348

* Move update notification to seperate class

- Add a couple of linebreaks to the chat messages
This commit is contained in:
NotMyFault
2021-10-17 09:55:25 +02:00
committed by GitHub
parent e5fbc4c971
commit 5db9a601b1
6 changed files with 103 additions and 3 deletions

View File

@ -2,6 +2,8 @@ package com.fastasyncworldedit.core;
/**
* An internal FAWE class not meant for public use.
*
* @hidden
**/
public class FaweVersion {
@ -46,12 +48,19 @@ public class FaweVersion {
@Override
public String toString() {
if (hash == 0 && build == 0) {
return "FastAsyncWorldEdit-1.17-NoVer-SNAPSHOT";
return getSimpleVersionName() + "-NoVer-SNAPSHOT";
} else {
return "FastAsyncWorldEdit-1.17" + build;
return getSimpleVersionName() + "-" + build;
}
}
/**
* @return The qualified version name
*/
public String getSimpleVersionName() {
return "FastAsyncWorldEdit-1.17";
}
public boolean isNewer(FaweVersion other) {
return other.build < this.build;
}

View File

@ -92,6 +92,8 @@ public class Settings extends Config {
@Comment({"Show additional information in console. It helps us at IntellectualSites to find out more about an issue.",
"Leave it off if you don't need it, it can spam your console."})
public boolean DEBUG = false;
@Comment({"Whether or not FAWE should notify you on startup about new versions available."})
public boolean UPDATE_NOTIFICATIONS = true;
}