aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2023-06-28 06:25:16 +1000
committerGitHub <noreply@github.com>2023-06-27 22:25:16 +0200
commit5862bb5cbf4712a0a6dca9b4ecbd7715f90c6b14 (patch)
tree9f491466dee00a6f9f1fc18cdad2c66c473f85e7 /src/main/java
parentd5572d881082259c48dcdbe02d4af3a29b781c46 (diff)
downloadNotEnoughUpdates-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
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CookieWarning.java24
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;