diff options
author | Wilhelm Schuster <ws@rot13.io> | 2023-05-06 16:28:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-06 16:28:33 +0200 |
commit | b39e9e6fd548aa5dd65bddc4e53ffca77a2518bf (patch) | |
tree | 5df59c826a7b7641b3212337520082c27adac16d /src/main/java/gregtech/api/util | |
parent | 228a726aaed50cd35346ed65369f1c1fddd2cd26 (diff) | |
download | GT5-Unofficial-b39e9e6fd548aa5dd65bddc4e53ffca77a2518bf.tar.gz GT5-Unofficial-b39e9e6fd548aa5dd65bddc4e53ffca77a2518bf.tar.bz2 GT5-Unofficial-b39e9e6fd548aa5dd65bddc4e53ffca77a2518bf.zip |
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.
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_Utility.java | 4 |
1 files changed, 4 insertions, 0 deletions
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)); } |