aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util/GT_Waila.java
blob: 9ea42a1028b5bebc141cc585048297d5728b9217 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package gregtech.api.util;

public abstract class GT_Waila {

    public static String getMachineProgressString(boolean isActive, int maxProgress, int progress) {
        final String result;

        if (isActive) {
            if (maxProgress < 20) {
                result = String.format("Progress: %d ticks remaining", maxProgress);
            } else {
                result = String.format("Progress: %d s / %d s", progress / 20, maxProgress / 20);
            }
        } else {
            result = "Idle";
        }

        return result;
    }
}