From f34220a92af85a33d979edb24ac5c3e698498fe3 Mon Sep 17 00:00:00 2001 From: Lulonaut <67191924+Lulonaut@users.noreply.github.com> Date: Wed, 22 Jun 2022 14:41:15 +0200 Subject: 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 --- .../moulberry/notenoughupdates/util/Utils.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java') 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 + ); + } } -- cgit