diff options
author | syeyoung <cyoung06@naver.com> | 2023-02-27 02:09:01 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2023-02-27 02:09:01 +0900 |
commit | b86f521aec51783d9bcf5fb153bce851f9e4536a (patch) | |
tree | d1b22ab518eded8896469240cd2140dd106cb0ae /mod/src/main | |
parent | 7055654f7fd676ba915cdf5a0295d6a9224cffef (diff) | |
download | Skyblock-Dungeons-Guide-b86f521aec51783d9bcf5fb153bce851f9e4536a.tar.gz Skyblock-Dungeons-Guide-b86f521aec51783d9bcf5fb153bce851f9e4536a.tar.bz2 Skyblock-Dungeons-Guide-b86f521aec51783d9bcf5fb153bce851f9e4536a.zip |
- Fix IntegerFormatException due to minute on clock: FetureEpicCountdown
- Also remove unnecessary volatile (no multithreading)
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'mod/src/main')
-rw-r--r-- | mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureEpicCountdown.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureEpicCountdown.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureEpicCountdown.java index 5baab534..76339e11 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureEpicCountdown.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureEpicCountdown.java @@ -38,8 +38,8 @@ import java.util.Objects; */ public class FeatureEpicCountdown extends SimpleFeature { - static volatile long updatedAt; - static volatile int secondsLeft; + static long updatedAt; + static int secondsLeft; private static boolean cleanChat; private boolean sfxenabled; @@ -108,6 +108,10 @@ public class FeatureEpicCountdown extends SimpleFeature { String line = TextUtils.stripColor(score.getJustTeam()); if(line.contains("Starting in:")){ String time = line.replace("Starting in: ", "").replace("§r", "").replace("0:", ""); + if (time.contains(":")) { + secondsLeft = Integer.parseInt(time.split(":")[0]) * 60 + Integer.parseInt(time.split(":")[1]); + updatedAt = System.currentTimeMillis(); + } if(!time.isEmpty()){ secondsLeft = Integer.parseInt(time); updatedAt = System.currentTimeMillis(); |