From 28ab4c4bf298e01c4e8b54c185725fa6d923aac4 Mon Sep 17 00:00:00 2001 From: DEv0on Date: Tue, 9 Jul 2024 21:37:03 +0200 Subject: [PATCH] Fix invalid unit on current charge on batteries (#1562) --- .../gtceu/api/item/component/ElectricStats.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/component/ElectricStats.java b/src/main/java/com/gregtechceu/gtceu/api/item/component/ElectricStats.java index a887622806..bed0261d17 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/component/ElectricStats.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/component/ElectricStats.java @@ -156,22 +156,18 @@ private static void addCurrentChargeTooltip(List tooltip, long curren long currentChargeTime; long maxChargeTime; String unit; - if (durationCurrent.getSeconds() <= 180) { - currentChargeTime = durationCurrent.getSeconds(); - } else if (durationCurrent.toMinutes() <= 180) { - currentChargeTime = durationCurrent.toMinutes(); - } else { - currentChargeTime = durationCurrent.toHours(); - } if (durationMax.getSeconds() <= 180) { maxChargeTime = durationMax.getSeconds(); + currentChargeTime = durationCurrent.toSeconds(); unit = LocalizationUtils.format("item.gtceu.battery.charge_unit.second"); } else if (durationMax.toMinutes() <= 180) { maxChargeTime = durationMax.toMinutes(); + currentChargeTime = durationCurrent.toMinutes(); unit = LocalizationUtils.format("item.gtceu.battery.charge_unit.minute"); } else { maxChargeTime = durationMax.toHours(); + currentChargeTime = durationCurrent.toHours(); unit = LocalizationUtils.format("item.gtceu.battery.charge_unit.hour"); }