diff options
author | nea <romangraef@gmail.com> | 2022-07-13 13:22:43 +0200 |
---|---|---|
committer | nea <romangraef@gmail.com> | 2022-07-13 13:22:43 +0200 |
commit | 45f14b700b71861c59d75d3f6efb2fd979a48b72 (patch) | |
tree | fa9688f89e1760badc11df778ccc5e132f2f2785 /src | |
parent | 0418663a058a5337b01af9d729c2a6548994836b (diff) | |
download | NotEnoughUpdates-45f14b700b71861c59d75d3f6efb2fd979a48b72.tar.gz NotEnoughUpdates-45f14b700b71861c59d75d3f6efb2fd979a48b72.tar.bz2 NotEnoughUpdates-45f14b700b71861c59d75d3f6efb2fd979a48b72.zip |
Dont reset the config lolforkering
Diffstat (limited to 'src')
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( |