@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);
  }
  @Override
  public void renderTileEntityAt(TileEntity t, double x, double y, double z, float pt) {
    Block blockType = t.getBlockType();

    Tessellator tes = Tessellator.instance;
    tes.setColorOpaque_F(1.0F, 1.0F, 1.0F);

    renderBlocks.blockAccess = t.getWorldObj();

    {
      if (Minecraft.isAmbientOcclusionEnabled()) {
        GL11.glShadeModel(GL11.GL_SMOOTH);
      } else {
        GL11.glShadeModel(GL11.GL_FLAT);
      }
      RenderHelper.disableStandardItemLighting();

      RenderUtils.loadTexture(TextureMap.locationBlocksTexture);

      tes.startDrawingQuads();
      tes.setTranslation(x - t.xCoord, y - t.yCoord, z - t.zCoord);

      renderBlocks.renderBlockAllFaces(blockType, t.xCoord, t.yCoord, t.zCoord);
      tes.setTranslation(0, 0, 0);
      tes.draw();

      RenderHelper.enableStandardItemLighting();
    }
  }
  public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
    int i;
    if (tileentity.getWorldObj() == null) {
      i = 0;
    } else {
      Block block = tileentity.getBlockType();
      i = tileentity.getBlockMetadata();
      if ((block != null) && (i == 0)) {
        i = tileentity.getBlockMetadata();
      }
    }

    GL11.glPushMatrix();
    GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
    Minecraft.getMinecraft().renderEngine.bindTexture(texture);
    GL11.glPushMatrix();
    GL11.glRotatef(180.0F, 180.0F, 0.0F, 0.0F);
    int j = 0;
    if (i == 3) {
      j = 0;
    }
    if (i == 2) {
      j = 180;
    }
    if (i == 4) {
      j = 90;
    }
    if (i == 5) {
      j = 270;
    }
    GL11.glRotatef(j, 0.0F, 1.0F, 0.0F);
    this.model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
    GL11.glPopMatrix();
    GL11.glPopMatrix();
  }
Пример #4
0
 public static void check(TileEntity te) {
   for (SegmentTileEntity segment : segmentsTile.get(te.getClass())) {
     if (!segment.shouldExist(te)) {
       ItemStack itemStack = new ItemStack(te.getBlockType(), 1, te.getBlockMetadata());
       NBTTagCompound nbt = new NBTTagCompound();
       te.writeToNBT(nbt);
       itemStack.setTagCompound(nbt);
       WorldUtils.dropAsEntity(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, itemStack);
       te.getWorldObj().setBlock(te.xCoord, te.yCoord, te.zCoord, Blocks.air);
       te.invalidate();
       MyTown.instance.LOG.info("TileEntity {} was ATOMICALLY DISINTEGRATED!", te.toString());
       return;
     }
   }
 }
 public boolean getMutliBlock() {
   for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
     TileEntity tileEntity =
         worldObj.getTileEntity(
             xCoord + direction.offsetX, yCoord + direction.offsetY, zCoord + direction.offsetZ);
     if (tileEntity instanceof TileMachineCasing) {
       if ((tileEntity.getBlockType() instanceof BlockMachineCasing)) {
         int heat;
         heat = BlockMachineCasing.getHeatFromMeta(tileEntity.getBlockMetadata());
         Location location = new Location(xCoord, yCoord, zCoord, direction);
         location.modifyPositionFromSide(direction, 1);
         if (worldObj
             .getBlock(location.getX(), location.getY(), location.getZ())
             .getUnlocalizedName()
             .equals("tile.lava")) {
           heat += 500;
         }
         return true;
       }
     }
   }
   return false;
 }