From 7559057336c2b4ff84deca2c35e59f39c95a7552 Mon Sep 17 00:00:00 2001 From: Vladislav Laetansky <87545780+vlaetansky@users.noreply.github.com> Date: Sat, 10 Sep 2022 16:24:16 +0300 Subject: Waila improvements for basic machines (#1368) * Fix waila facings for basic machines * Address review * Show process time only when machine is active * Show tick time for recipes with a duration less than a second * Address review --- src/main/java/gregtech/api/util/GT_Waila.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/main/java/gregtech/api/util/GT_Waila.java (limited to 'src/main/java/gregtech/api/util') diff --git a/src/main/java/gregtech/api/util/GT_Waila.java b/src/main/java/gregtech/api/util/GT_Waila.java new file mode 100644 index 0000000000..9ea42a1028 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_Waila.java @@ -0,0 +1,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; + } +} -- cgit