From b39e9e6fd548aa5dd65bddc4e53ffca77a2518bf Mon Sep 17 00:00:00 2001 From: Wilhelm Schuster Date: Sat, 6 May 2023 16:28:33 +0200 Subject: Show energy flow amperage and correct voltage tier in WAILA for machine blocks (#1955) Previously, WAILA just showed voltage tier based on total energy flow. This was problematic for machines that accept multiple amps such as the Arc Furnace. Even though it can accept up to 3A of input, increasing the total input voltage by one tier, it obviously cannot accept that voltage from a single source. --- src/main/java/gregtech/api/util/GT_Utility.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main/java/gregtech/api/util') diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 0e1d3cae1e..bc6cc9b1b2 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -465,6 +465,10 @@ public class GT_Utility { return (byte) (V.length - 1); } + public static long getAmperageForTier(long voltage, byte tier) { + return ceilDiv(voltage, GT_Values.V[tier]); + } + public static String getColoredTierNameFromVoltage(long voltage) { return getColoredTierNameFromTier(getTier(voltage)); } -- cgit