diff options
author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2023-06-28 06:25:16 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 22:25:16 +0200 |
commit | 5862bb5cbf4712a0a6dca9b4ecbd7715f90c6b14 (patch) | |
tree | 9f491466dee00a6f9f1fc18cdad2c66c473f85e7 | |
parent | d5572d881082259c48dcdbe02d4af3a29b781c46 (diff) | |
download | NotEnoughUpdates-5862bb5cbf4712a0a6dca9b4ecbd7715f90c6b14.tar.gz NotEnoughUpdates-5862bb5cbf4712a0a6dca9b4ecbd7715f90c6b14.tar.bz2 NotEnoughUpdates-5862bb5cbf4712a0a6dca9b4ecbd7715f90c6b14.zip |
Fix cookie alert and sb menu thingy (#742)
surely hypixel wouldnt randomly change the case of words
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CookieWarning.java | 24 |
1 files changed, 13 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 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; |