GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void render(float x, float y, float z, float scale, ItemStack stack){
IProgWidget widget = ItemProgrammingPuzzle.getWidgetForPiece(stack);
if(widget == null) return;
int width = widget.getWidth() + (widget.getParameters() != null && widget.getParameters().length > 0 ? 10 : 0);
int height = widget.getHeight() + (widget.hasStepOutput() ? 5 : 0);
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
// GL11.glDisable(GL11.GL_LIGHTING);
// GL11.glRotatef(-90F, 1F, 0, 0);
// Scale, Translate, Rotate
scale = scale / Math.max(height, width);
GL11.glScalef(scale, scale, 1);
GL11.glTranslatef(-width / 2, -height / 2, 0);
// GL11.glTranslatef(x, y, z);
//GL11.glRotatef(-90F, 1F, 0, 0);
widget.render();
// GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}