From 15307a0b42952b0326c2842da5105f62d6ba752d Mon Sep 17 00:00:00 2001 From: Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> Date: Sat, 11 Feb 2023 12:04:04 +0000 Subject: Fix EU consumption displayed on NEI (#1728) * Fix EU consumption displayed on NEI * Typo --------- Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> --- src/main/java/gregtech/api/util/GT_Recipe.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/main/java/gregtech/api/util') diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index 53b3dd9f9b..524976adc9 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -1,6 +1,7 @@ package gregtech.api.util; import static gregtech.api.enums.GT_Values.*; +import static gregtech.api.util.GT_Utility.formatNumbers; import static net.minecraft.util.EnumChatFormatting.GRAY; import java.awt.*; @@ -1794,9 +1795,13 @@ public class GT_Recipe implements Comparable { @Override protected void drawNEIEnergyInfo(NEIRecipeInfo recipeInfo) { - Power power = recipeInfo.power; - drawNEIText(recipeInfo, GT_Utility.trans("152", "Total: ") + power.getTotalPowerString()); - drawNEIText(recipeInfo, "Average: " + power.getPowerUsageString()); + // These look odd because recipeInfo.recipe.mEUt is actually the EU per litre of fluid processed, not + // the EU/t. + drawNEIText( + recipeInfo, + GT_Utility.trans("152", "Total: ") + formatNumbers(1000L * recipeInfo.recipe.mEUt) + " EU"); + // 1000 / (20 ticks * 5 seconds) = 10L/t. 10L/t * x EU/L = 10 * x EU/t. + drawNEIText(recipeInfo, "Average: " + formatNumbers(10L * recipeInfo.recipe.mEUt) + " EU/t"); } } @@ -3472,7 +3477,7 @@ public class GT_Recipe implements Comparable { } protected String formatSpecialValue(int specialValue) { - return mNEISpecialValuePre + GT_Utility.formatNumbers((long) specialValue * mNEISpecialValueMultiplier) + return mNEISpecialValuePre + formatNumbers((long) specialValue * mNEISpecialValueMultiplier) + mNEISpecialValuePost; } -- cgit