From 5862bb5cbf4712a0a6dca9b4ecbd7715f90c6b14 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 28 Jun 2023 06:25:16 +1000 Subject: Fix cookie alert and sb menu thingy (#742) surely hypixel wouldnt randomly change the case of words --- .../miscfeatures/CookieWarning.java | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src') 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 f130a993..80fd4515 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CookieWarning.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CookieWarning.java @@ -27,6 +27,8 @@ import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.util.EnumChatFormatting; +import java.util.Locale; + public class CookieWarning { private static boolean hasNotified; @@ -88,26 +90,26 @@ public class CookieWarning { String number = digits[i]; String unit = digits[i + 1]; long val = Integer.parseInt(number); - switch (unit) { - case "Years": - case "Year": + switch (unit.toLowerCase(Locale.ROOT)) { + case "years": + case "year": minutes += val * 525600; break; - case "Months": - case "Month": + case "months": + case "month": minutes += val * 43200; break; - case "Days": - case "Day": + case "days": + case "day": minutes += val * 1440; break; - case "Hours": - case "Hour": + case "hours": + case "hour": case "h": minutes += val * 60; break; - case "Minutes": - case "Minute": + case "minutes": + case "minute": case "m": minutes += val; break; -- cgit