コード例 #1
0
 @Override
 public void renderTileEntityAt(
     TileEntity tile, double par2, double par4, double par6, float par8) {
   if (tile.hasWorldObj() && MinecraftForgeClient.getRenderPass() == 0) {
     CrystalTransmitterBase te = (CrystalTransmitterBase) tile;
     GL11.glPushMatrix();
     GL11.glTranslated(par2, par4, par6);
     ChromaFX.drawEnergyTransferBeams(new WorldLocation(te), te.getTargets());
     GL11.glPopMatrix();
   }
 }
 @Override
 public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float delta) {
   int metadata = 0;
   if (tileEntity.hasWorldObj()) {
     metadata = tileEntity.getBlockMetadata();
   }
   GL11.glPushMatrix();
   boolean oldRescaleNormal = GL11.glIsEnabled(GL12.GL_RESCALE_NORMAL);
   if (oldRescaleNormal) {
     GL11.glEnable(GL12.GL_RESCALE_NORMAL);
   }
   GL11.glColor4f(1f, 1f, 1f, 1f);
   GL11.glTranslatef((float) x, (float) y + 1f, (float) z);
   GL11.glTranslatef(0.5f, 0.5f, 0.5f);
   float angle;
   switch (ForgeDirection.getOrientation(metadata)) {
     case NORTH:
       angle = 0;
       break;
     case EAST:
       angle = -90;
       break;
     case SOUTH:
       angle = 180;
       break;
     case WEST:
       angle = 90;
       break;
     default:
       angle = -90;
   }
   GL11.glRotatef(angle, 0f, 1f, 0f);
   GL11.glRotatef(180f, 0f, 0f, 1f);
   bindTexture(texture);
   model.renderAll();
   if (!oldRescaleNormal) {
     GL11.glDisable(GL12.GL_RESCALE_NORMAL);
   }
   GL11.glPopMatrix();
   GL11.glColor4f(1f, 1f, 1f, 1f);
   TileEntityCookingTable tileEntityTable = (TileEntityCookingTable) tileEntity;
   if (tileEntityTable.hasNoFilterBook()) {
     GL11.glPushMatrix();
     GL11.glTranslatef((float) x + 0.5f, (float) y + 0.9f, (float) z + 0.5f);
     GL11.glRotatef(angle, 0f, 1f, 0f);
     GL11.glTranslatef(0f, 0f, -0.2f);
     GL11.glRotatef(90f, 1f, 0f, 0f);
     RenderManager.instance.renderEntityWithPosYaw(
         tileEntityTable.getRenderItem(), 0, 0, 0, 0f, 0f);
     GL11.glPopMatrix();
   }
 }
  @Override
  public void renderStatic(
      TileEntity tile, Tessellator tes, Matrix4 translationMatrix, Matrix4 rotationMatrix) {
    translationMatrix.translate(.5, .5, .5);

    if (tile.hasWorldObj()) {
      switch (tile.getBlockMetadata()) {
        case 0:
          break;
        case 1:
          rotationMatrix.rotate(Math.toRadians(180), 0, 0, 1);
          break;
        case 2:
          rotationMatrix.rotate(Math.toRadians(90), 1, 0, 0);
          break;
        case 3:
          rotationMatrix.rotate(Math.toRadians(-90), 1, 0, 0);
          break;
        case 4:
          rotationMatrix.rotate(Math.toRadians(-90), 0, 0, 1);
          break;
        case 5:
          rotationMatrix.rotate(Math.toRadians(90), 0, 0, 1);
          break;
      }
    }

    if (tile.hasWorldObj()) {
      if (tile instanceof TileRedstoneWireConnector
          && ((TileRedstoneWireConnector) tile).isInput()) {
        modelInput.render(tile, tes, translationMatrix, rotationMatrix, 0, false, "connectorMV");
      } else {
        modelOutput.render(tile, tes, translationMatrix, rotationMatrix, 0, false, "connectorMV");
      }
    } else {
      modelOutput.render(tile, tes, translationMatrix, rotationMatrix, 0, false);
    }
  }
コード例 #4
0
 @Override
 public final void renderTileEntityAt(
     TileEntity tile, double par2, double par4, double par6, float par8) {
   GL11.glPushMatrix();
   GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
   GL11.glDisable(GL11.GL_ALPHA_TEST);
   GL11.glDisable(GL11.GL_LIGHTING);
   GL11.glDisable(GL11.GL_CULL_FACE);
   GL11.glEnable(GL11.GL_BLEND);
   GL11.glDepthMask(false);
   GL11.glColor4f(1, 1, 1, 1);
   GL11.glTranslated(par2, par4, par6);
   if (MinecraftForgeClient.getRenderPass() == 1 || !tile.hasWorldObj())
     this.renderCore((TileEntityLocusPoint) tile, par2, par4, par6, par8);
   this.doOtherRendering((TileEntityLocusPoint) tile, par8);
   GL11.glPopAttrib();
   GL11.glPopMatrix();
 }
  @Override
  public void renderDynamic(TileEntity tile, double x, double y, double z, float f) {
    super.renderDynamic(tile, x, y, z, f);

    if (tile instanceof TileRedstoneWireConnector) {
      GL11.glPushMatrix();

      int hex = ItemDye.field_150922_c[15 - ((TileRedstoneWireConnector) tile).redstoneChannel];
      int r = (hex & 0xFF0000) >> 16;
      int g = (hex & 0xFF00) >> 8;
      int b = (hex & 0xFF);

      GL11.glColor3f(r / 255f, g / 255f, b / 255f);
      GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);

      if (tile.hasWorldObj()) {
        switch (tile.getBlockMetadata()) {
          case 0:
            break;
          case 1:
            GL11.glRotatef(180, 0, 0, 1);
            break;
          case 2:
            GL11.glRotatef(90, 1, 0, 0);
            break;
          case 3:
            GL11.glRotatef(-90, 1, 0, 0);
            break;
          case 4:
            GL11.glRotatef(-90, 0, 0, 1);
            break;
          case 5:
            GL11.glRotatef(90, 0, 0, 1);
            break;
        }
      }

      Minecraft.getMinecraft().renderEngine.bindTexture(channelTexture);
      modelChannel.renderAll();
      GL11.glPopMatrix();
    }
  }