Пример #1
0
  @Override
  public boolean renderWorldBlock(
      IBlockAccess world, int x, int y, int z, Block b, int modelId, RenderBlocks rb) {
    Tessellator v5 = Tessellator.instance;
    int meta = world.getBlockMetadata(x, y, z);

    BlockTieredOre t = (BlockTieredOre) b;
    if (t.isPlayerSufficientTier(world, x, y, z, Minecraft.getMinecraft().thePlayer)) {
      if (TieredOres.list[meta].renderAsGeode()) {
        this.renderGeode(world, x, y, z, b, meta, rb);
        // this.renderSimpleGeode(world, x, y, z, b, meta, rb);
      } else {
        rb.renderStandardBlockWithAmbientOcclusion(b, x, y, z, 1, 1, 1);

        IIcon ico = t.getOverlay(meta);
        v5.setBrightness(240);
        v5.setColorOpaque(255, 255, 255);
        if (b.shouldSideBeRendered(world, x, y - 1, z, ForgeDirection.DOWN.ordinal()))
          rb.renderFaceYNeg(b, x, y, z, ico);
        if (b.shouldSideBeRendered(world, x, y + 1, z, ForgeDirection.UP.ordinal()))
          rb.renderFaceYPos(b, x, y, z, ico);
        if (b.shouldSideBeRendered(world, x, y, z - 1, ForgeDirection.NORTH.ordinal()))
          rb.renderFaceZNeg(b, x, y, z, ico);
        if (b.shouldSideBeRendered(world, x, y, z + 1, ForgeDirection.SOUTH.ordinal()))
          rb.renderFaceZPos(b, x, y, z, ico);
        if (b.shouldSideBeRendered(world, x - 1, y, z, ForgeDirection.WEST.ordinal()))
          rb.renderFaceXNeg(b, x, y, z, ico);
        if (b.shouldSideBeRendered(world, x + 1, y, z, ForgeDirection.EAST.ordinal()))
          rb.renderFaceXPos(b, x, y, z, ico);
      }
    } else {
      rb.renderBlockAllFaces(t.getDisguise(meta), x, y, z);
      // rb.renderStandardBlockWithAmbientOcclusion(t.getDisguise(), x, y, z, 1, 1, 1);
    }
    return true;
  }
Пример #2
0
  @Override
  public void renderInventoryBlock(Block b, int metadata, int modelId, RenderBlocks rb) {
    BlockTieredOre bt = (BlockTieredOre) b;
    Tessellator v5 = Tessellator.instance;

    rb.renderMaxX = 1;
    rb.renderMinY = 0;
    rb.renderMaxZ = 1;
    rb.renderMinX = 0;
    rb.renderMinZ = 0;
    rb.renderMaxY = 1;

    boolean tier =
        bt.getProgressStage(metadata).isPlayerAtStage(Minecraft.getMinecraft().thePlayer);
    IIcon ico = tier ? bt.getBacking(metadata) : bt.getDisguise(metadata).getIcon(0, 0);

    if (!tier || !TieredOres.list[metadata].renderAsGeode()) {
      GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
      GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
      v5.startDrawingQuads();
      v5.setNormal(0.0F, -1.0F, 0.0F);
      rb.renderFaceYNeg(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();

      v5.startDrawingQuads();
      v5.setNormal(0.0F, 1.0F, 0.0F);
      rb.renderFaceYPos(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();

      v5.startDrawingQuads();
      v5.setNormal(0.0F, 0.0F, -1.0F);
      rb.renderFaceZNeg(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();
      v5.startDrawingQuads();
      v5.setNormal(0.0F, 0.0F, 1.0F);
      rb.renderFaceZPos(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();
      v5.startDrawingQuads();
      v5.setNormal(-1.0F, 0.0F, 0.0F);
      rb.renderFaceXNeg(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();
      v5.startDrawingQuads();
      v5.setNormal(1.0F, 0.0F, 0.0F);
      rb.renderFaceXPos(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();
    }

    if (tier) {
      if (TieredOres.list[metadata].renderAsGeode()) {
        GL11.glPushMatrix();
        GL11.glTranslated(-0.5, -0.5, -0.5);
        v5.startDrawingQuads();
        this.renderGeode(null, 0, 0, 0, bt, metadata, rb);
        v5.draw();
        GL11.glPopMatrix();
      } else {
        ico = ((BlockTieredOre) b).getOverlay(metadata);
        v5.startDrawingQuads();
        v5.setNormal(0.0F, -1.0F, 0.0F);
        rb.renderFaceYNeg(b, 0.0D, 0.0D, 0.0D, ico);
        v5.draw();

        v5.startDrawingQuads();
        v5.setNormal(0.0F, 1.0F, 0.0F);
        rb.renderFaceYPos(b, 0.0D, 0.0D, 0.0D, ico);
        v5.draw();

        v5.startDrawingQuads();
        v5.setNormal(0.0F, 0.0F, -1.0F);
        rb.renderFaceZNeg(b, 0.0D, 0.0D, 0.0D, ico);
        v5.draw();
        v5.startDrawingQuads();
        v5.setNormal(0.0F, 0.0F, 1.0F);
        rb.renderFaceZPos(b, 0.0D, 0.0D, 0.0D, ico);
        v5.draw();
        v5.startDrawingQuads();
        v5.setNormal(-1.0F, 0.0F, 0.0F);
        rb.renderFaceXNeg(b, 0.0D, 0.0D, 0.0D, ico);
        v5.draw();
        v5.startDrawingQuads();
        v5.setNormal(1.0F, 0.0F, 0.0F);
        rb.renderFaceXPos(b, 0.0D, 0.0D, 0.0D, ico);
        v5.draw();
      }
    }

    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
  }