Multimeter can now detect temperature
This commit is contained in:
parent
c643a40ca9
commit
9a444efca1
3 changed files with 12 additions and 1 deletions
|
@ -31,7 +31,8 @@ public class MultimeterNetwork extends Network<MultimeterNetwork, PartMultimeter
|
|||
|
||||
public final GraphI fluidGraph = new GraphI(maxData);
|
||||
|
||||
|
||||
public final GraphF thermalGraph = new GraphF(maxData);
|
||||
|
||||
/**
|
||||
* The absolute center of the multimeter screens.
|
||||
*/
|
||||
|
@ -66,6 +67,7 @@ public class MultimeterNetwork extends Network<MultimeterNetwork, PartMultimeter
|
|||
graphs.add(torqueGraph);
|
||||
graphs.add(angularVelocityGraph);
|
||||
graphs.add(fluidGraph);
|
||||
graphs.add(thermalGraph);
|
||||
}
|
||||
|
||||
public boolean isPrimary(PartMultimeter check)
|
||||
|
|
|
@ -20,6 +20,7 @@ import universalelectricity.api.electricity.IElectricalNetwork;
|
|||
import universalelectricity.api.energy.IConductor;
|
||||
import universalelectricity.api.energy.IEnergyNetwork;
|
||||
import universalelectricity.api.net.IConnector;
|
||||
import atomicscience.api.ITemperature;
|
||||
import calclavia.lib.network.IPacketReceiver;
|
||||
import codechicken.lib.data.MCDataInput;
|
||||
import codechicken.lib.data.MCDataOutput;
|
||||
|
@ -281,6 +282,11 @@ public class PartMultimeter extends PartFace implements IConnector<MultimeterNet
|
|||
}
|
||||
}
|
||||
|
||||
if (tileEntity instanceof ITemperature)
|
||||
{
|
||||
getNetwork().thermalGraph.queue(((ITemperature) tileEntity).getTemperature());
|
||||
}
|
||||
|
||||
getNetwork().energyGraph.queue(CompatibilityModule.getEnergy(tileEntity, receivingSide));
|
||||
|
||||
/**
|
||||
|
|
|
@ -217,6 +217,9 @@ public class RenderMultimeter implements ISimpleItemRenderer
|
|||
if (part.getNetwork().fluidGraph.get(0) != 0)
|
||||
information.add("Fluid: " + UnitDisplay.getDisplay(part.getNetwork().fluidGraph.get(0), Unit.LITER));
|
||||
|
||||
if (part.getNetwork().thermalGraph.get(0) != 0)
|
||||
information.add("Temperature: " + UnitDisplay.roundDecimals(part.getNetwork().thermalGraph.get(0) - 273) + " C");
|
||||
|
||||
if (information.size() <= 0)
|
||||
information.add("No information");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue