Merge pull request #2844 from HenryLoenwind/defensiveProgramming

Added some defensive null checking
This commit is contained in:
tterrag1098 committed 2015-09-23 15:45:15 -04:00
commit 1096ca7f1d
1 file changed
+7 -4
@@ -6,6 +6,7 @@ import java.util.Random;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraftforge.client.model.obj.GroupObject;
import org.lwjgl.opengl.GL11;
@@ -59,9 +60,11 @@ public class TelePadSpecialRenderer extends TileEntitySpecialRenderer {
}
private void render(GroupObject model, TileEntity te, Tessellator tes) {
tes.startDrawingQuads();
TechneUtil.renderWithIcon(model, te.getBlockType().getIcon(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, 0), null,
Tessellator.instance, te.getWorldObj(), 0, 0, 0, null, false);
tes.draw();
final IIcon icon = te.getBlockType().getIcon(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, 0);
if (icon != null && model != null) {
tes.startDrawingQuads();
TechneUtil.renderWithIcon(model, icon, null, Tessellator.instance, te.getWorldObj(), 0, 0, 0, null, false);
tes.draw();
}
}
}