aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
diff options
context:
space:
mode:
authorLulonaut <67191924+Lulonaut@users.noreply.github.com>2022-06-22 14:41:15 +0200
committerGitHub <noreply@github.com>2022-06-22 14:41:15 +0200
commitf34220a92af85a33d979edb24ac5c3e698498fe3 (patch)
treed36bcc12b1fd4116003c1c36cb09666f0e3f36c1 /src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
parent439fc22ff04b0f5b0201c2d982bceb18d82fd553 (diff)
downloadnotenoughupdates-f34220a92af85a33d979edb24ac5c3e698498fe3.tar.gz
notenoughupdates-f34220a92af85a33d979edb24ac5c3e698498fe3.tar.bz2
notenoughupdates-f34220a92af85a33d979edb24ac5c3e698498fe3.zip
bug fixes (#172)
* yikes * cookie warning * better wording in docs * edit items in parent that are the bounds of the item list * totalCount not updating when not present * unplayable * comment? * outdated repo notification * more notification * crash * more crash * cookie bug
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
index b6447706..ce0ecc4a 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
@@ -1391,6 +1391,11 @@ public class Utils {
}
}
+ public static JsonElement getElementOrDefault(JsonElement element, String path, JsonElement def) {
+ JsonElement result = getElement(element, path);
+ return result != null ? result : def;
+ }
+
public static ChatStyle createClickStyle(ClickEvent.Action action, String value) {
ChatStyle style = new ChatStyle();
style.setChatClickEvent(new ClickEvent(action, value));
@@ -1927,4 +1932,19 @@ public class Utils {
}
return stringBuilder.toString();
}
+
+ public static void showOutdatedRepoNotification() {
+ NotificationHandler.displayNotification(Lists.newArrayList(
+ EnumChatFormatting.RED + EnumChatFormatting.BOLD.toString() + "Missing repo data",
+ EnumChatFormatting.RED + "Data used for many NEU features is not up to date, this should normally not be the case.",
+ EnumChatFormatting.RED + "You can try " + EnumChatFormatting.BOLD + "/neuresetrepo" + EnumChatFormatting.RESET +
+ EnumChatFormatting.RED + " to see if that fixes the issue.",
+ EnumChatFormatting.RED + "If the problem persists please join " + EnumChatFormatting.BOLD +
+ "discord.gg/moulberry" +
+ EnumChatFormatting.RESET + EnumChatFormatting.RED + " and message in " + EnumChatFormatting.BOLD +
+ "#neu-support" + EnumChatFormatting.RESET + EnumChatFormatting.RED + " to get support"
+ ),
+ true, true
+ );
+ }
}