Fixed #10 - Render wire NPE

This commit is contained in:
Calclavia 2013-08-14 08:45:26 +08:00
parent 84ba19fc19
commit a52b4d39a3

View file

@ -31,11 +31,13 @@ public class RenderWire extends TileEntitySpecialRenderer
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(COPPER_TEXTURE); FMLClientHandler.instance().getClient().renderEngine.func_110577_a(COPPER_TEXTURE);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
GL11.glScalef(1.0F, -1F, -1F); GL11.glScalef(1, -1, -1);
tileEntity.adjacentConnections = null; tileEntity.adjacentConnections = null;
TileEntity[] adjacentConnections = tileEntity.getAdjacentConnections(); TileEntity[] adjacentConnections = tileEntity.getAdjacentConnections();
if (adjacentConnections != null)
{
if (adjacentConnections[0] != null) if (adjacentConnections[0] != null)
{ {
WIRE_MODEL.renderBottom(); WIRE_MODEL.renderBottom();
@ -65,6 +67,7 @@ public class RenderWire extends TileEntitySpecialRenderer
{ {
WIRE_MODEL.renderRight(); WIRE_MODEL.renderRight();
} }
}
WIRE_MODEL.renderMiddle(); WIRE_MODEL.renderMiddle();
GL11.glPopMatrix(); GL11.glPopMatrix();