@Override
  public void doRender() {

    GL11.glPushMatrix();
    GL11.glCallList(displayList);
    GL11.glPopMatrix();
  }
  protected void doFlush() {
    if (!(activeShader instanceof BasicShader))
      throw new IllegalStateException("Need Basic Shader in 1.1 mode");

    GL11.glNewList(displayList, GL11.GL_COMPILE);
    ((BasicShader) activeShader).assign(true);
    GL11.glPushMatrix();
    GL11.glBegin(renderMode);
    for (int i = 0; i < numVerticies; i += 1) {
      int index = i * 4;
      if (useColors)
        GL11.glColor3f(
            colorBuffer.get(index), colorBuffer.get(index + 1), colorBuffer.get(index + 2));
      if (useNormals)
        GL11.glNormal3f(
            normalBuffer.get(index), normalBuffer.get(index + 1), normalBuffer.get(index + 2));
      if (useTextures) GL11.glTexCoord2f(uvBuffer.get((i * 2)), uvBuffer.get((i * 2) + 1));
      GL11.glVertex4f(
          vertexBuffer.get(index),
          vertexBuffer.get(index + 1),
          vertexBuffer.get(index + 2),
          vertexBuffer.get(index + 3));
    }
    GL11.glEnd();
    GL11.glPopMatrix();
    GL11.glEndList();
  }
    void unbind() {
      GL11.glPopAttrib();

      GL11.glMatrixMode(GL11.GL_PROJECTION);
      GL11.glPopMatrix();

      GL11.glMatrixMode(GL11.GL_MODELVIEW);
      GL11.glPopMatrix();

      if (lightmapEnabled) {
        GL13.glActiveTexture(GL13.GL_TEXTURE1);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL13.glActiveTexture(GL13.GL_TEXTURE0);
      }
      GL11.glEnable(GL11.GL_BLEND);
      GLAPI.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

      EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, 0);
    }
  @Override
  protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GL11.glPushMatrix();
    GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);

    if (inverted) {
      this.mc.renderEngine.bindTexture(
          new ResourceLocation(
              "uncraftingTable:textures/gui/container/uncrafting_gui_redstoned.png"));
    } else
      this.mc.renderEngine.bindTexture(
          new ResourceLocation("uncraftingTable:textures/gui/container/uncrafting_gui.png"));

    int k = width / 2 - xSize / 2;
    int l = height / 2 - ySize / 2;
    this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
    GL11.glPopMatrix();
  }
 private void renderImpl(double angle) {
   for (Layer layer : layers) {
     layer.blendMethod.applyBlending();
     GL11.glPushMatrix();
     TexturePackAPI.bindTexture(layer.textureName);
     float offsetX = layer.offsetX;
     float offsetY = layer.offsetY;
     float scaleX = layer.scaleX;
     float scaleY = layer.scaleY;
     if (layer.debug) {
       offsetX += offsetXDelta;
       offsetY += offsetYDelta;
       scaleX += scaleXDelta;
       scaleY += scaleYDelta;
     }
     GL11.glTranslatef(offsetX, offsetY, 0.0f);
     GL11.glScalef(scaleX, scaleY, 1.0f);
     float layerAngle = (float) (angle * layer.rotationMultiplier + layer.rotationOffset);
     GL11.glRotatef(layerAngle, 0.0f, 0.0f, 1.0f);
     GL11.glCallList(drawList);
     GL11.glPopMatrix();
   }
 }