Fixed a multimeter multipart crash
This commit is contained in:
parent
10c2794e35
commit
dcfdb7ad03
2 changed files with 7 additions and 5 deletions
|
@ -261,11 +261,13 @@ public class PartMultimeter extends JCuboidPart implements IConnector<Multimeter
|
||||||
|
|
||||||
if (instance != null)
|
if (instance != null)
|
||||||
{
|
{
|
||||||
|
if (instance.getNetwork() instanceof IEnergyNetwork)
|
||||||
|
{
|
||||||
IEnergyNetwork network = instance.getNetwork();
|
IEnergyNetwork network = instance.getNetwork();
|
||||||
getNetwork().energyGraph.queue(Math.max(network.getBuffer(), network.getLastBuffer()));
|
getNetwork().energyGraph.queue(Math.max(network.getBuffer(), network.getLastBuffer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (tileEntity instanceof IMechanical)
|
if (tileEntity instanceof IMechanical)
|
||||||
{
|
{
|
||||||
|
|
|
@ -165,14 +165,14 @@ public class RenderMultimeter
|
||||||
information.add("Speed: " + UnitDisplay.roundDecimals(part.getNetwork().angularVelocityGraph.get(0)));
|
information.add("Speed: " + UnitDisplay.roundDecimals(part.getNetwork().angularVelocityGraph.get(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glTranslatef(0, 0, -0.25f * (information.size() / 2));
|
GL11.glTranslatef(0, 0, -0.18f * (information.size() / 2));
|
||||||
|
|
||||||
for (int i = 0; i < information.size(); i++)
|
for (int i = 0; i < information.size(); i++)
|
||||||
{
|
{
|
||||||
String info = information.get(i);
|
String info = information.get(i);
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glTranslatef(0, 0, 0.25f * i);
|
GL11.glTranslatef(0, 0, 0.2f * i);
|
||||||
if (dir.offsetX == 0)
|
if (dir.offsetX == 0)
|
||||||
RenderUtility.renderText(info, (float) (part.getNetwork().size.x * 0.9f), 0.5f);
|
RenderUtility.renderText(info, (float) (part.getNetwork().size.x * 0.9f), 0.5f);
|
||||||
if (dir.offsetZ == 0)
|
if (dir.offsetZ == 0)
|
||||||
|
|
Loading…
Reference in a new issue