diff options
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/location/ParkIslandHandler.java')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/location/ParkIslandHandler.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/ParkIslandHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/ParkIslandHandler.java new file mode 100644 index 0000000..2a41391 --- /dev/null +++ b/src/main/java/com/thatgravyboat/skyblockhud/location/ParkIslandHandler.java @@ -0,0 +1,31 @@ +package com.thatgravyboat.skyblockhud.location; + +import javax.annotation.Nullable; + +public class ParkIslandHandler { + + private static boolean isRaining = false; + private static String rainTime = ""; + + public static void parseRain(@Nullable String tabLine){ + if (tabLine == null){ + isRaining = false; + rainTime = ""; + } + else if (tabLine.toLowerCase().contains("rain:")){ + if (tabLine.toLowerCase().contains("no rain")) isRaining = false; + else { + rainTime = tabLine.toLowerCase().replace("rain:", "").replace(" ", ""); + isRaining = true; + } + } + } + + public static String getRainTime(){ + return rainTime; + } + + public static boolean isRaining(){ + return isRaining; + } +} |