Multimeter now displays voltage
This commit is contained in:
parent
68e7bcef1a
commit
2ab0cf924d
3 changed files with 10 additions and 6 deletions
|
@ -25,6 +25,7 @@ public class MultimeterNetwork extends Network<MultimeterNetwork, PartMultimeter
|
|||
*/
|
||||
public final GraphL energyGraph = new GraphL(maxData);
|
||||
public final GraphL energyCapacityGraph = new GraphL(1);
|
||||
public final GraphL voltageGraph = new GraphL(maxData);
|
||||
public final GraphL torqueGraph = new GraphL(maxData);
|
||||
public final GraphF angularVelocityGraph = new GraphF(maxData);
|
||||
|
||||
|
@ -60,6 +61,7 @@ public class MultimeterNetwork extends Network<MultimeterNetwork, PartMultimeter
|
|||
{
|
||||
graphs.add(energyGraph);
|
||||
graphs.add(energyCapacityGraph);
|
||||
graphs.add(voltageGraph);
|
||||
graphs.add(torqueGraph);
|
||||
graphs.add(angularVelocityGraph);
|
||||
graphs.add(fluidGraph);
|
||||
|
@ -154,7 +156,7 @@ public class MultimeterNetwork extends Network<MultimeterNetwork, PartMultimeter
|
|||
|
||||
if (primaryMultimeter == null)
|
||||
primaryMultimeter = node;
|
||||
|
||||
|
||||
if (upperBound == null)
|
||||
{
|
||||
upperBound = node.getPosition().translate(1);
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package resonantinduction.electrical.multimeter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -19,6 +16,7 @@ import resonantinduction.core.ResonantInduction;
|
|||
import resonantinduction.core.prefab.part.PartFace;
|
||||
import resonantinduction.electrical.Electrical;
|
||||
import universalelectricity.api.CompatibilityModule;
|
||||
import universalelectricity.api.electricity.IElectricalNetwork;
|
||||
import universalelectricity.api.energy.IConductor;
|
||||
import universalelectricity.api.energy.IEnergyNetwork;
|
||||
import universalelectricity.api.net.IConnector;
|
||||
|
@ -27,9 +25,7 @@ import codechicken.lib.data.MCDataInput;
|
|||
import codechicken.lib.data.MCDataOutput;
|
||||
import codechicken.lib.vec.Cuboid6;
|
||||
import codechicken.lib.vec.Vector3;
|
||||
import codechicken.microblock.FaceMicroClass;
|
||||
import codechicken.multipart.IRedstonePart;
|
||||
import codechicken.multipart.NormalOcclusionTest;
|
||||
import codechicken.multipart.TMultiPart;
|
||||
import codechicken.multipart.TileMultipart;
|
||||
|
||||
|
@ -244,6 +240,9 @@ public class PartMultimeter extends PartFace implements IConnector<MultimeterNet
|
|||
{
|
||||
IEnergyNetwork network = instance.getNetwork();
|
||||
getNetwork().energyGraph.queue(Math.max(network.getBuffer(), network.getLastBuffer()));
|
||||
|
||||
if (instance.getNetwork() instanceof IElectricalNetwork)
|
||||
getNetwork().voltageGraph.queue(((IElectricalNetwork) network).getVoltage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,6 +180,9 @@ public class RenderMultimeter implements ISimpleItemRenderer
|
|||
if (part.getNetwork().energyCapacityGraph.get(0) > 0)
|
||||
information.add("Max: " + UnitDisplay.getDisplay(part.getNetwork().energyCapacityGraph.get(0), Unit.JOULES));
|
||||
|
||||
if (part.getNetwork().voltageGraph.get(0) > 0)
|
||||
information.add(UnitDisplay.getDisplay(part.getNetwork().voltageGraph.get(0), Unit.VOLTAGE));
|
||||
|
||||
if (part.getNetwork().torqueGraph.get(0) != 0)
|
||||
information.add("Torque: " + UnitDisplay.getDisplayShort(part.getNetwork().torqueGraph.get(0), Unit.NEWTON_METER));
|
||||
|
||||
|
|
Loading…
Reference in a new issue