From a52b4d39a3a649223deeeb397c3201b37e6dc300 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Wed, 14 Aug 2013 08:45:26 +0800 Subject: [PATCH] Fixed #10 - Render wire NPE --- src/resonantinduction/render/RenderWire.java | 49 +++++++++++--------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/src/resonantinduction/render/RenderWire.java b/src/resonantinduction/render/RenderWire.java index a80356965..e17a26bc5 100644 --- a/src/resonantinduction/render/RenderWire.java +++ b/src/resonantinduction/render/RenderWire.java @@ -31,39 +31,42 @@ public class RenderWire extends TileEntitySpecialRenderer FMLClientHandler.instance().getClient().renderEngine.func_110577_a(COPPER_TEXTURE); GL11.glPushMatrix(); 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 = tileEntity.getAdjacentConnections(); - if (adjacentConnections[0] != null) + if (adjacentConnections != null) { - WIRE_MODEL.renderBottom(); - } + if (adjacentConnections[0] != null) + { + WIRE_MODEL.renderBottom(); + } - if (adjacentConnections[1] != null) - { - WIRE_MODEL.renderTop(); - } + if (adjacentConnections[1] != null) + { + WIRE_MODEL.renderTop(); + } - if (adjacentConnections[2] != null) - { - WIRE_MODEL.renderBack(); - } + if (adjacentConnections[2] != null) + { + WIRE_MODEL.renderBack(); + } - if (adjacentConnections[3] != null) - { - WIRE_MODEL.renderFront(); - } + if (adjacentConnections[3] != null) + { + WIRE_MODEL.renderFront(); + } - if (adjacentConnections[4] != null) - { - WIRE_MODEL.renderLeft(); - } + if (adjacentConnections[4] != null) + { + WIRE_MODEL.renderLeft(); + } - if (adjacentConnections[5] != null) - { - WIRE_MODEL.renderRight(); + if (adjacentConnections[5] != null) + { + WIRE_MODEL.renderRight(); + } } WIRE_MODEL.renderMiddle();