From 2482504b5020741d2498cfa825b25c0caf6932b7 Mon Sep 17 00:00:00 2001 From: Dimach Date: Fri, 28 Jul 2017 16:12:40 +0300 Subject: [PATCH] Added new function to GT scanner - print voltage and amperage of electric cable at last second. --- src/main/java/gregtech/api/util/GT_Utility.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index ec4db394..acc5c9da 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -14,6 +14,7 @@ import gregtech.api.interfaces.IProjectileItem; import gregtech.api.interfaces.tileentity.*; import gregtech.api.items.GT_EnergyArmor_Item; import gregtech.api.items.GT_Generic_Item; +import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; import gregtech.api.net.GT_Packet_Sound; import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.ItemData; @@ -1732,6 +1733,15 @@ public class GT_Utility { } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); } + try { + if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable) { + GT_MetaPipeEntity_Cable c = (GT_MetaPipeEntity_Cable) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); + tList.add("Max voltage last second " + c.mTransferredVoltageLast20); + tList.add("Max amperage last second " + c.mTransferredAmperageLast20); + } + } catch (Throwable e) { + if (D1) e.printStackTrace(GT_Log.err); + } try { if (tTileEntity instanceof IBasicEnergyContainer && ((IBasicEnergyContainer) tTileEntity).getEUCapacity() > 0) { tList.add(trans("179","Max IN: ") + ((IBasicEnergyContainer) tTileEntity).getInputVoltage() + trans("180"," EU"));