Skip to content

Commit a43e045

Browse files
Show required energy in Quantum controller when out of power
1 parent abc910b commit a43e045

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main/java/gregtech/integration/theoneprobe/provider/QuantumStorageProvider.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer play
3131
if (blockState.getBlock().hasTileEntity(blockState) &&
3232
world.getTileEntity(data.getPos()) instanceof IGregTechTileEntity gtte) {
3333
if (gtte.getMetaTileEntity() instanceof IQuantumController controller) {
34+
String eutText = configureEnergyUsage(controller.getEnergyUsage() / 10);
3435
if (controller.getCount(IQuantumStorage.Type.ENERGY) == 0) {
3536
probeInfo.text("{*gregtech.top.quantum_controller.no_hatches*}");
3637
} else if (!controller.isPowered()) {
3738
probeInfo.text("{*gregtech.top.quantum_controller.no_power*}");
39+
probeInfo.text(TextStyleClass.INFO + "{*gregtech.top.energy_required*} " + eutText);
3840
} else {
39-
long usage = controller.getEnergyUsage();
40-
configureEnergyUsage(usage / 10, probeInfo);
41+
probeInfo.text(TextStyleClass.INFO + "{*gregtech.top.energy_consumption*} " + eutText);
4142
}
4243
} else if (gtte.getMetaTileEntity() instanceof IQuantumStorage<?>storage &&
4344
(storage.getType() == IQuantumStorage.Type.ITEM ||
@@ -59,10 +60,8 @@ public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer play
5960
"{*" + status + "*}";
6061
}
6162

62-
public void configureEnergyUsage(long EUs, IProbeInfo probeInfo) {
63-
if (EUs == 0) return;
64-
String text = TextFormatting.RED.toString() + EUs + TextStyleClass.INFO + " EU/t" + TextFormatting.GREEN +
63+
public String configureEnergyUsage(long EUs) {
64+
return TextFormatting.RED.toString() + EUs + TextStyleClass.INFO + " EU/t" + TextFormatting.GREEN +
6565
" (" + GTValues.VNF[GTUtility.getTierByVoltage(EUs)] + TextFormatting.GREEN + ")";
66-
probeInfo.text(TextStyleClass.INFO + "{*gregtech.top.energy_consumption*} " + text);
6766
}
6867
}

src/main/resources/assets/gregtech/lang/en_us.lang

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ gregtech.top.working_disabled=Working Disabled
6868

6969
gregtech.top.energy_consumption=Using
7070
gregtech.top.energy_production=Producing
71+
gregtech.top.energy_required=Requires
7172

7273
gregtech.top.transform_up=Step Up
7374
gregtech.top.transform_down=Step Down

0 commit comments

Comments
 (0)