From 2cd45dc50ca58fe265f637d84800de7dad96cdda Mon Sep 17 00:00:00 2001 From: Lulonaut <67191924+Lulonaut@users.noreply.github.com> Date: Thu, 30 Jun 2022 11:02:16 +0200 Subject: cookie bug (v2) (#175) --- .../miscfeatures/CookieWarning.java | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CookieWarning.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CookieWarning.java index ca1865cd..f21d0c50 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CookieWarning.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CookieWarning.java @@ -62,13 +62,15 @@ public class CookieWarning { } } if (!hasCookie) { - NotificationHandler.displayNotification(Lists.newArrayList( - "\u00a7cBooster Cookie Ran Out!", - "\u00a77Your Booster Cookie expired!", - "\u00a77", - "\u00a77Press X on your keyboard to close this notification" - ), true, true); - hasNotified = true; + if (!hasNotified) { + NotificationHandler.displayNotification(Lists.newArrayList( + "\u00a7cBooster Cookie Ran Out!", + "\u00a77Your Booster Cookie expired!", + "\u00a77", + "\u00a77Press X on your keyboard to close this notification" + ), true, true); + hasNotified = true; + } return; } if (timeLine != null) { @@ -97,7 +99,7 @@ public class CookieWarning { "NEU ran into an issue when retrieving the Booster Cookie Timer. Check the logs for details.")); hasNotified = true; } - if (minutes < NotEnoughUpdates.INSTANCE.config.notifications.boosterCookieWarningMins) { + if (minutes < NotEnoughUpdates.INSTANCE.config.notifications.boosterCookieWarningMins && !hasNotified) { NotificationHandler.displayNotification(Lists.newArrayList( "\u00a7cBooster Cookie Running Low!", "\u00a77Your Booster Cookie will expire in " + timeLine, @@ -105,9 +107,6 @@ public class CookieWarning { "\u00a77Press X on your keyboard to close this notification" ), true, true); hasNotified = true; - } else if (hasNotified) { - NotificationHandler.cancelNotification(); - hasNotified = false; } } } -- cgit