1010import net .neganote .gtutilities .GregTechModernUtilities ;
1111import net .neganote .gtutilities .common .machine .multiblock .PTERBMachine ;
1212
13+ import net .neganote .gtutilities .common .materials .UtilMaterials ;
14+ import net .neganote .gtutilities .config .UtilConfig ;
1315import snownee .jade .api .BlockAccessor ;
1416import snownee .jade .api .IBlockComponentProvider ;
1517import snownee .jade .api .IServerDataProvider ;
1618import snownee .jade .api .ITooltip ;
1719import snownee .jade .api .config .IPluginConfig ;
1820
19- public class PTERBFrequencyProvider implements IBlockComponentProvider , IServerDataProvider <BlockAccessor > {
21+ public class PTERBInformationProvider implements IBlockComponentProvider , IServerDataProvider <BlockAccessor > {
2022
2123 @ Override
2224 public void appendTooltip (ITooltip iTooltip , BlockAccessor blockAccessor , IPluginConfig iPluginConfig ) {
2325 BlockEntity be = blockAccessor .getBlockEntity ();
24- if (be instanceof MetaMachineBlockEntity mmbe && mmbe .getMetaMachine () instanceof PTERBMachine ) {
26+ if (be instanceof MetaMachineBlockEntity mmbe && mmbe .getMetaMachine () instanceof PTERBMachine pterb ) {
2527 CompoundTag data = blockAccessor .getServerData ().getCompound (getUid ().toString ());
26- if (data .contains ("frequencyData " )) {
27- var tag = data .getCompound ("frequencyData " );
28+ if (data .contains ("pterbData " )) {
29+ var tag = data .getCompound ("pterbData " );
2830 iTooltip .add (Component .translatable ("gtmutils.pterb.current_frequency" ,
2931 FormattingUtil .formatNumbers (tag .getInt ("currentFrequency" ))));
32+ if (tag .contains ("coolantDrain" ) && UtilConfig .coolantEnabled () && pterb .isFormed ()) {
33+ iTooltip .add (Component .translatable ("gtmutils.multiblock.pterb_machine.coolant_usage" ,
34+ FormattingUtil .formatNumbers (tag .getInt ("coolantDrain" )),
35+ UtilMaterials .QuantumCoolant .getLocalizedName ()));
36+ }
3037 }
3138 }
3239 }
@@ -36,15 +43,19 @@ public void appendServerData(CompoundTag compoundTag, BlockAccessor blockAccesso
3643 CompoundTag data = compoundTag .getCompound (getUid ().toString ());
3744 if (blockAccessor .getBlockEntity () instanceof MetaMachineBlockEntity mmbe &&
3845 mmbe .getMetaMachine () instanceof PTERBMachine pterb ) {
39- CompoundTag freqData = new CompoundTag ();
40- freqData .putInt ("currentFrequency" , pterb .getFrequency ());
41- data .put ("frequencyData" , freqData );
46+ CompoundTag pterbData = new CompoundTag ();
47+ pterbData .putInt ("currentFrequency" , pterb .getFrequency ());
48+ if (UtilConfig .coolantEnabled () && pterb .isFormed ()) {
49+ int coolantDrain = pterb .getCoolantDrain ();
50+ pterbData .putInt ("coolantDrain" , coolantDrain );
51+ }
52+ data .put ("pterbData" , pterbData );
4253 }
4354 compoundTag .put (getUid ().toString (), data );
4455 }
4556
4657 @ Override
4758 public ResourceLocation getUid () {
48- return GregTechModernUtilities .id ("frequency_info " );
59+ return GregTechModernUtilities .id ("pterb_info " );
4960 }
5061}
0 commit comments