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();
   }
 }
Пример #2
0
  @Override
  public void renderContentLayer(int localWidth, int localHeight, boolean isTranslatable) {
    String tStation = StatCollector.translateToLocal("manual.page.modifier1");
    if (icons.length > 3) tStation = StatCollector.translateToLocal("manual.page.modifier2");
    if (icons.length > 4) tStation = StatCollector.translateToLocal("manual.page.modifier3");
    if (isTranslatable) tStation = StatCollector.translateToLocal(tStation);
    manual.fonts.drawString("\u00a7n" + tStation, localWidth + 60, localHeight + 4, 0);
    GL11.glScalef(2f, 2f, 2f);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    RenderHelper.enableGUIStandardItemLighting();

    ItemStack toolstack = MantleClientRegistry.getManualIcon("ironpick");
    if (type.equals("weapon")) toolstack = MantleClientRegistry.getManualIcon("ironlongsword");
    if (type.equals("travelgoggles"))
      toolstack = MantleClientRegistry.getManualIcon("travelgoggles");
    if (type.equals("travelvest")) toolstack = MantleClientRegistry.getManualIcon("travelvest");
    if (type.equals("travelwings")) toolstack = MantleClientRegistry.getManualIcon("travelwings");
    if (type.equals("travelboots")) toolstack = MantleClientRegistry.getManualIcon("travelboots");
    if (type.equals("travelbelt")) toolstack = MantleClientRegistry.getManualIcon("travelbelt");
    if (type.equals("travelglove")) toolstack = MantleClientRegistry.getManualIcon("travelglove");
    if (type.equals("travelmulti")) toolstack = toolMulti[counter];

    // update displayed item
    if (iconsMulti != null
        && iconsMulti.length > 0
        && type.equals("travelmulti")
        && System.currentTimeMillis() - lastUpdate > 1000) {
      lastUpdate = System.currentTimeMillis();
      counter++;
      if (counter >= iconsMulti.length) counter = 0;
      icons = iconsMulti[counter];
      toolstack = toolMulti[counter];
    }

    manual.renderitem.zLevel = 100;
    if (icons.length < 4) {
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          toolstack,
          (localWidth + 54) / 2,
          (localHeight + 54) / 2);
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          icons[0],
          (localWidth + 130) / 2,
          (localHeight + 54) / 2);
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          icons[1],
          (localWidth + 18) / 2,
          (localHeight + 36) / 2);
      if (icons[2] != null)
        manual.renderitem.renderItemAndEffectIntoGUI(
            manual.fonts,
            manual.getMC().renderEngine,
            icons[2],
            (localWidth + 18) / 2,
            (localHeight + 74) / 2);
    } else {
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          toolstack,
          (localWidth + 74) / 2,
          (localHeight + 54) / 2);
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          icons[0],
          (localWidth + 140) / 2,
          (localHeight + 54) / 2);
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          icons[1],
          (localWidth - 2) / 2,
          (localHeight + 36) / 2);
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          icons[2],
          (localWidth - 2) / 2,
          (localHeight + 74) / 2);
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          icons[3],
          (localWidth + 36) / 2,
          (localHeight + 36) / 2);
      if (icons[4] != null)
        manual.renderitem.renderItemAndEffectIntoGUI(
            manual.fonts,
            manual.getMC().renderEngine,
            icons[4],
            (localWidth + 36) / 2,
            (localHeight + 74) / 2);
    }
    manual.renderitem.zLevel = 0;

    GL11.glScalef(0.5F, 0.5F, 0.5F);
    RenderHelper.disableStandardItemLighting();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
  }