Fixed a multimeter multipart crash

This commit is contained in:
Calclavia 2014-02-05 11:33:58 +08:00
parent 10c2794e35
commit dcfdb7ad03
2 changed files with 7 additions and 5 deletions

View file

@ -261,9 +261,11 @@ public class PartMultimeter extends JCuboidPart implements IConnector<Multimeter
if (instance != null)
{
IEnergyNetwork network = instance.getNetwork();
getNetwork().energyGraph.queue(Math.max(network.getBuffer(), network.getLastBuffer()));
if (instance.getNetwork() instanceof IEnergyNetwork)
{
IEnergyNetwork network = instance.getNetwork();
getNetwork().energyGraph.queue(Math.max(network.getBuffer(), network.getLastBuffer()));
}
}
}

View file

@ -165,14 +165,14 @@ public class RenderMultimeter
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++)
{
String info = information.get(i);
GL11.glPushMatrix();
GL11.glTranslatef(0, 0, 0.25f * i);
GL11.glTranslatef(0, 0, 0.2f * i);
if (dir.offsetX == 0)
RenderUtility.renderText(info, (float) (part.getNetwork().size.x * 0.9f), 0.5f);
if (dir.offsetZ == 0)