aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/location/ParkIslandHandler.java
blob: b9628d0084d7f7fe2ead8dfae56752bbe66b3feb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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;
    }
}