Added new function to GT scanner - print voltage and amperage of electric cable at last second.

This commit is contained in:
Dimach 2017-07-28 16:12:40 +03:00
parent da2e748e8a
commit 2482504b50

View file

@ -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"));