diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-08-28 16:06:07 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-08-28 16:06:07 -0400 |
commit | 4a48ac021fa23aadb88f8f690880e6d58538fa0b (patch) | |
tree | 965c78ed236a30bb59ec592907f2abe086d5333c /src/main/java/me/Danker/utils | |
parent | c1ddb82463894e7a2604d85b57f5be640bfbf115 (diff) | |
download | SkyblockMod-4a48ac021fa23aadb88f8f690880e6d58538fa0b.tar.gz SkyblockMod-4a48ac021fa23aadb88f8f690880e6d58538fa0b.tar.bz2 SkyblockMod-4a48ac021fa23aadb88f8f690880e6d58538fa0b.zip |
Add coins and time (not working) to dungeons tracker, change pet colours
Change pet colours to the Steam level colours because I'm uncreative
Diffstat (limited to 'src/main/java/me/Danker/utils')
-rw-r--r-- | src/main/java/me/Danker/utils/Utils.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 45479f7..f0a612e 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -138,4 +138,33 @@ public class Utils { GL11.glTranslated(0, 0, -1); } + public static String getTimeBetween(double timeOne, double timeTwo) { + double secondsBetween = Math.floor(timeTwo - timeOne); + + String timeFormatted = ""; + int days; + int hours; + int minutes; + int seconds; + + if (secondsBetween > 86400) { + // More than 1d, display #d#h + days = (int) (secondsBetween / 86400); + hours = (int) (secondsBetween % 86400 / 3600); + timeFormatted = days + "d" + hours + "h"; + } else if (secondsBetween > 3600) { + // More than 1h, display #h#m + hours = (int) (secondsBetween / 3600); + minutes = (int) (secondsBetween % 3600 / 60); + timeFormatted = hours + "h" + minutes + "m"; + } else { + // Display #m#s + minutes = (int) (secondsBetween / 60); + seconds = (int) (secondsBetween % 60); + timeFormatted = minutes + "m" + seconds + "s"; + } + + return timeFormatted; + } + } |