@Override
  public void renderTileEntityAt(TileEntity t, double x, double y, double z, float partialTicks) {
    tile = (TileEntityHologramProjector) t;
    //		tile.arraySize.updateValue(tile.holoObjects);

    OpenGLM.pushMatrix();
    OpenGLM.translate(x, y, z);
    GL11U.texture(false);
    GL11U.glLighting(true);
    TessUtil.drawCube(
        t.getBlockType().getBlockBoundsMinX(),
        t.getBlockType().getBlockBoundsMinY(),
        t.getBlockType().getBlockBoundsMinZ(),
        t.getBlockType().getBlockBoundsMaxX(),
        t.getBlockType().getBlockBoundsMaxY(),
        t.getBlockType().getBlockBoundsMaxZ());
    GL11U.setUpOpaqueRendering(1);
    GL11U.glScale(0.99999);
    ColorF color =
        new ColorF(
            UtilM.fluctuateSmooth(10, 0) * 0.2 + tile.mainColor.x,
            UtilM.fluctuateSmooth(35, 0) * 0.2 + tile.mainColor.y,
            UtilM.fluctuateSmooth(16, 0) * 0.2 + tile.mainColor.z,
            0.2);
    color.bind();
    OpenGLM.translate(tile.offset.x, tile.offset.y - UtilM.p * 1.45F, 0.5F);
    tile.main.draw();
    OpenGLM.translate(tile.size.x, tile.size.y, 0);
    boolean selected = false;
    tile.selectedObj = null;
    Iterator<HoloObject> holos = tile.holoObjects.iterator();
    while (holos.hasNext()) {
      HoloObject ro = holos.next();
      if (ro.host == null) ro.host = tile;
      OpenGLM.pushMatrix();
      OpenGLM.translate(ro.position.x, ro.position.y, 0);
      ro.render(color);
      OpenGLM.popMatrix();
      if (((ro.getClass() == TextBox.class && tile.highlights[0])
              || (ro.getClass() == Button.class && tile.highlights[1])
              || (ro.getClass() == Slider.class && tile.highlights[3])
              || (ro.getClass() == Field.class && tile.highlights[2]))
          && !selected
          && (ro.isHighlighted || ro.moveMode)) {
        selected = true;
        OpenGLM.color(0, 0, 0, 0.4F);
        OpenGLM.lineWidth(1);
        GL11U.texture(false);
        ro.drawHighlight();
        GL11U.texture(true);
      }
    }
    GL11U.glColor(ColorF.WHITE);
    GL11U.glCulFace(true);
    GL11U.texture(true);
    GL11U.endOpaqueRendering();
    OpenGLM.popMatrix();

    //		tile.arraySize.updateValue(tile.holoObjects);
  }
Ejemplo n.º 2
0
  @Override
  public void render(int xScreen, int yScreen, float partialTicks) {
    if (data == null) data = ExtendedPlayerData.get(player);
    if (data == null) return;
    if (data.player != player) {
      data = ExtendedPlayerData.get(player);
    }
    if (data == null) return;
    FontRenderer fr = TessUtil.getFontRenderer();
    if (UtilM.isNull(player, fr)) return;
    if (handAlpha > 0 && UtilM.isItemInStack(MItems.theHand, player.getCurrentEquippedItem())) {
      float HandAlpha = PartialTicksUtil.calculatePos(lastHandAlpha, handAlpha);
      int slot = player.inventory.currentItem;
      OpenGLM.pushMatrix();

      int posId = 0;
      for (int b = 0; b < HandPosition.values().length; b++) {
        if (HandPosition.values()[b].equals(TheHandHandler.getActivePosition(player))) {
          posId = b;
          continue;
        }
      }
      int a1 = -1, a2 = -1, a3 = -1;
      if (posId == 1) {
        a1 = posId - 1;
        a2 = posId;
        a3 = posId + 1;
      } else if (posId == 0) {
        a1 = 2;
        a2 = posId;
        a3 = posId + 1;
      } else {
        a1 = 1;
        a2 = posId;
        a3 = 0;
      }
      String up = "string " + a1, now = "string " + a2, down = "string " + a3;

      GL11U.setUpOpaqueRendering(1);
      OpenGLM.translate(slot * 20 + xScreen / 2 - 95, yScreen - 38, 0);

      OpenGLM.translate(0, -HandAlpha * 20 + 20, 0);
      OpenGLM.translate(13, 0, 0);
      OpenGLM.scale(HandAlpha, HandAlpha, HandAlpha);
      OpenGLM.rotate(HandAlpha * 90 - 90, 0, 0, 1);
      OpenGLM.translate(-13, 0, 0);

      OpenGLM.translate(-10 + HandAlpha * 10, 0, 0);
      fr.drawStringWithShadow(up, 0, -9, Color.WHITE.hashCode());
      OpenGLM.translate(10 - HandAlpha * 10, 0, 0);
      fr.drawStringWithShadow(now, 0, 0, Color.WHITE.hashCode());
      OpenGLM.translate(10 - HandAlpha * 10, 0, 0);
      fr.drawStringWithShadow(down, 0, 9, Color.WHITE.hashCode());

      GL11U.endOpaqueRendering();
      OpenGLM.popMatrix();
    }
  }