aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2022-07-13 13:22:43 +0200
committernea <romangraef@gmail.com>2022-07-13 13:22:43 +0200
commit45f14b700b71861c59d75d3f6efb2fd979a48b72 (patch)
treefa9688f89e1760badc11df778ccc5e132f2f2785 /src
parent0418663a058a5337b01af9d729c2a6548994836b (diff)
downloadNotEnoughUpdates-45f14b700b71861c59d75d3f6efb2fd979a48b72.tar.gz
NotEnoughUpdates-45f14b700b71861c59d75d3f6efb2fd979a48b72.tar.bz2
NotEnoughUpdates-45f14b700b71861c59d75d3f6efb2fd979a48b72.zip
Dont reset the config lolforkering
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java3
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/NEUEventListener.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Notifications.java2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
index 82db6373..76387844 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
@@ -215,7 +215,8 @@ public class NotEnoughUpdates {
))
) {
config = gson.fromJson(reader, NEUConfig.class);
- } catch (Exception ignored) {
+ } catch (Exception exc) {
+ new RuntimeException("Invalid config file. This will reset the config to default", exc).printStackTrace();
}
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/NEUEventListener.java
index d5b39487..26c2d1f9 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/listener/NEUEventListener.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/NEUEventListener.java
@@ -131,7 +131,7 @@ public class NEUEventListener {
boolean hasPreReleaseAvailableForUpdate =
fullReleaseVersion == NotEnoughUpdates.VERSION_ID && preReleaseVersion > NotEnoughUpdates.PRE_VERSION_ID;
- int updateChannel = NotEnoughUpdates.INSTANCE.config.notifications.showUpdateMsg; /* 1 = Full, 2 = Pre */
+ int updateChannel = NotEnoughUpdates.INSTANCE.config.notifications.updateChannel; /* 1 = Full, 2 = Pre */
if (hasFullReleaseAvailableForUpgrade || (hasHotfixAvailableForUpgrade && updateChannel == 1)) {
displayUpdateMessage(o, o.get("update_msg").getAsString(), o.get("update_link").getAsString());
} else if (hasPreReleaseAvailableForUpdate && updateChannel == 2) {
@@ -265,7 +265,7 @@ public class NEUEventListener {
if (!joinedSB) {
joinedSB = true;
- if (NotEnoughUpdates.INSTANCE.config.notifications.showUpdateMsg != 0) {
+ if (NotEnoughUpdates.INSTANCE.config.notifications.updateChannel != 0) {
displayUpdateMessageIfOutOfDate();
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Notifications.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Notifications.java
index c89110aa..e25a535f 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Notifications.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Notifications.java
@@ -32,7 +32,7 @@ public class Notifications {
desc = "Give a notification in chat whenever a new version of NEU is released"
)
@ConfigEditorDropdown(values = {"Off", "Releases", "Pre-Releases"})
- public int showUpdateMsg = 1;
+ public int updateChannel = 1;
@Expose
@ConfigOption(