Package net.minecraft.client.renderer

Examples of net.minecraft.client.renderer.Tessellator


  @Override
  protected void renderConduit(IIcon tex, IConduit conduit, CollidableComponent component, float selfIllum) {
    if(IInsulatedRedstoneConduit.COLOR_CONTROLLER_ID.equals(component.data)) {
      if(conduit.containsExternalConnection(component.dir)) {
        int c = ((IInsulatedRedstoneConduit) conduit).getSignalColor(component.dir).getColor();
        Tessellator tessellator = Tessellator.instance;
        tessellator.setColorOpaque_I(c);
        CubeRenderer.render(component.bound, tex);
        tessellator.setColorOpaque(255, 255, 255);
      }
    } else {
      super.renderConduit(tex, conduit, component, selfIllum);
    }
  }
View Full Code Here


      if (tileEntity.getMode() != null)
      {
        /**
         * Render Projection
         */
        Tessellator tessellator = Tessellator.instance;

        RenderHelper.disableStandardItemLighting();
        GL11.glPushMatrix();
        GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);

        double xDifference = Minecraft.getMinecraft().thePlayer.posX - (tileEntity.xCoord + 0.5);
        double zDifference = Minecraft.getMinecraft().thePlayer.posZ - (tileEntity.zCoord + 0.5);
        float rotatation = (float) Math.toDegrees(Math.atan2(zDifference, xDifference));
        GL11.glRotatef(-rotatation + 27, 0.0F, 1.0F, 0.0F);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glShadeModel(GL11.GL_SMOOTH);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
        GL11.glDisable(GL11.GL_ALPHA_TEST);
        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glDepthMask(false);
        GL11.glPushMatrix();

        tessellator.startDrawing(6);
        float height = 2;
        float width = 2;
        tessellator.setColorRGBA(72, 198, 255, 255);
        tessellator.addVertex(0.0D, 0.0D, 0.0D);
        tessellator.setColorRGBA_I(0, 0);
        tessellator.addVertex(-0.866D * width, height, -0.5F * width);
        tessellator.addVertex(0.866D * width, height, -0.5F * width);
        tessellator.addVertex(0.0D, height, 1.0F * width);
        tessellator.addVertex(-0.866D * width, height, -0.5F * width);
        tessellator.draw();

        GL11.glPopMatrix();
        GL11.glDepthMask(true);
        GL11.glDisable(GL11.GL_CULL_FACE);
        GL11.glDisable(GL11.GL_BLEND);
 
View Full Code Here

    float uScale = maxU - minU;
    float vScale = maxV - minV;

    Vector3d offset = calcOffset(dir, bounds);

    Tessellator tes = Tessellator.instance;
    Vertex[] coords;
    if(isStub) {
      coords = DIR_STUB_COORDS[dir.ordinal()];
    } else {
      coords = DIR_COORDS[dir.ordinal()];
    }

    for (Vertex coord : coords) {
      double u = minU + (coord.uv.x * uScale);
      double v = minV + (coord.uv.y * vScale);
      tes.setNormal(coord.normal.x, coord.normal.y, coord.normal.z);
      tes.addVertexWithUV(offset.x + coord.xyz.x, offset.y + coord.xyz.y, offset.z + coord.xyz.z, u, v);
    }

    if(isStub) {
      coords = DIR_STUB_CAPS[dir.ordinal()];
      for (Vertex coord : coords) {
        double u = minU + (coord.uv.x * uScale);
        double v = minV + (coord.uv.y * vScale);
        tes.setNormal(coord.normal.x, coord.normal.y, coord.normal.z);
        tes.addVertexWithUV(offset.x + coord.xyz.x, offset.y + coord.xyz.y, offset.z + coord.xyz.z, u, v);
      }
    }
  }
View Full Code Here

    float uWidth = tex.getMaxU() - tex.getMinU();
    float uScale = uWidth * 0.64f;
    float minU = tex.getMinU() + (uWidth - uScale);
    float vScale = tex.getMaxV() - tex.getMinV();

    Tessellator tes = Tessellator.instance;
    for (Vertex v : verts) {
      if(tintSides) {
        float cm = 1;
        if(v.ny() > 0.1) {
          cm = RenderUtil.getColorMultiplierForFace(ForgeDirection.UP);
        } else if(v.ny() < -0.1) {
          cm = RenderUtil.getColorMultiplierForFace(ForgeDirection.DOWN);
        } else if(v.nx() > 0.1) {
          cm = RenderUtil.getColorMultiplierForFace(ForgeDirection.EAST);
        } else if(v.nx() < -0.1) {
          cm = RenderUtil.getColorMultiplierForFace(ForgeDirection.WEST);
        } else if(v.nz() > 0.1) {
          cm = RenderUtil.getColorMultiplierForFace(ForgeDirection.SOUTH);
        } else if(v.nz() < -0.1) {
          cm = RenderUtil.getColorMultiplierForFace(ForgeDirection.NORTH);
        }
        tes.setColorOpaque_F(cm, cm, cm);
      }

      tes.setNormal(v.nx(), v.ny(), v.nz());
      tes.addVertexWithUV(v.x() + trans.x, v.y() + trans.y, v.z() + trans.z, minU + (v.u() * uScale), tex.getMinV() + (v.v() * vScale));
    }

  }
View Full Code Here

    {
      GL11.glPopMatrix();
      return;
    }

    Tessellator tessellator = Tessellator.instance;
    float f = icon.getMinU();
    float f1 = icon.getMaxU();
    float f2 = icon.getMinV();
    float f3 = icon.getMaxV();
    float f4 = 0.0F;
View Full Code Here

  @SideOnly(Side.CLIENT)
  @Override
  public void render(IProjector projector, double x, double y, double z, float f, long ticks)
  {
    Tessellator tessellator = Tessellator.instance;

    GL11.glPushMatrix();
    GL11.glRotatef(180, 0, 0, 1);

    float height = 0.5f;
    float width = 0.3f;
    int uvMaxX = 2;
    int uvMaxY = 2;
    Vector3 translation = new Vector3(0, -0.4, 0);
    tessellator.startDrawing(6);
    tessellator.setColorRGBA(72, 198, 255, 255);
    tessellator.addVertexWithUV(0 + translation.x, 0 + translation.y, 0 + translation.z, 0, 0);
    tessellator.addVertexWithUV(-width + translation.x, height + translation.y, -width + translation.z, -uvMaxX, -uvMaxY);
    tessellator.addVertexWithUV(-width + translation.x, height + translation.y, width + translation.z, -uvMaxX, uvMaxY);
    tessellator.addVertexWithUV(width + translation.x, height + translation.y, width + translation.z, uvMaxX, uvMaxY);
    tessellator.addVertexWithUV(width + translation.x, height + translation.y, -width + translation.z, uvMaxX, -uvMaxY);
    tessellator.addVertexWithUV(-width + translation.x, height + translation.y, -width + translation.z, -uvMaxX, -uvMaxY);
    tessellator.draw();
    GL11.glPopMatrix();
  }
View Full Code Here

        return this.renderBlockHopperMetadata(par1BlockHopper, par2, par3, par4, renderer.blockAccess.getBlockMetadata(par2, par3, par4), false, renderer);
    }

    public boolean renderBlockHopperMetadata (BlazeHopper par1BlockHopper, int par2, int par3, int par4, int par5, boolean par6, RenderBlocks renderer)
    {
        Tessellator tessellator = Tessellator.instance;
        int i1 = BlockHopper.getDirectionFromMetadata(par5);
        double d0 = 0.625D;
        renderer.setRenderBounds(0.0D, d0, 0.0D, 1.0D, 1.0D, 1.0D);

        if (par6)
        {
            tessellator.startDrawingQuads();
            tessellator.setNormal(0.0F, -1.0F, 0.0F);
            renderer.renderFaceYNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(par1BlockHopper, 0, par5));
            tessellator.draw();
            tessellator.startDrawingQuads();
            tessellator.setNormal(0.0F, 1.0F, 0.0F);
            renderer.renderFaceYPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(par1BlockHopper, 1, par5));
            tessellator.draw();
            tessellator.startDrawingQuads();
            tessellator.setNormal(0.0F, 0.0F, -1.0F);
            renderer.renderFaceZNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(par1BlockHopper, 2, par5));
            tessellator.draw();
            tessellator.startDrawingQuads();
            tessellator.setNormal(0.0F, 0.0F, 1.0F);
            renderer.renderFaceZPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(par1BlockHopper, 3, par5));
            tessellator.draw();
            tessellator.startDrawingQuads();
            tessellator.setNormal(-1.0F, 0.0F, 0.0F);
            renderer.renderFaceXNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(par1BlockHopper, 4, par5));
            tessellator.draw();
            tessellator.startDrawingQuads();
            tessellator.setNormal(1.0F, 0.0F, 0.0F);
            renderer.renderFaceXPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(par1BlockHopper, 5, par5));
            tessellator.draw();
        }
        else
        {
            renderer.renderStandardBlock(par1BlockHopper, par2, par3, par4);
        }

        float f;

        if (!par6)
        {
            tessellator.setBrightness(par1BlockHopper.getMixedBrightnessForBlock(renderer.blockAccess, par2, par3, par4));
            float f1 = 1.0F;
            int j1 = par1BlockHopper.colorMultiplier(renderer.blockAccess, par2, par3, par4);
            f = (j1 >> 16 & 255) / 255.0F;
            float f2 = (j1 >> 8 & 255) / 255.0F;
            float f3 = (j1 & 255) / 255.0F;

            if (EntityRenderer.anaglyphEnable)
            {
                float f4 = (f * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
                float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F;
                float f6 = (f * 30.0F + f3 * 70.0F) / 100.0F;
                f = f4;
                f2 = f5;
                f3 = f6;
            }

            tessellator.setColorOpaque_F(f1 * f, f1 * f2, f1 * f3);
        }

        IIcon icon = BlazeHopper.hopperIcon("hopper_outside");
        IIcon icon1 = BlazeHopper.hopperIcon("hopper_inside");
        f = 0.125F;

        if (par6)
        {
            tessellator.startDrawingQuads();
            tessellator.setNormal(1.0F, 0.0F, 0.0F);
            renderer.renderFaceXPos(par1BlockHopper, -1.0F + f, 0.0D, 0.0D, icon);
            tessellator.draw();
            tessellator.startDrawingQuads();
            tessellator.setNormal(-1.0F, 0.0F, 0.0F);
            renderer.renderFaceXNeg(par1BlockHopper, 1.0F - f, 0.0D, 0.0D, icon);
            tessellator.draw();
            tessellator.startDrawingQuads();
            tessellator.setNormal(0.0F, 0.0F, 1.0F);
            renderer.renderFaceZPos(par1BlockHopper, 0.0D, 0.0D, -1.0F + f, icon);
            tessellator.draw();
            tessellator.startDrawingQuads();
            tessellator.setNormal(0.0F, 0.0F, -1.0F);
            renderer.renderFaceZNeg(par1BlockHopper, 0.0D, 0.0D, 1.0F - f, icon);
            tessellator.draw();
            tessellator.startDrawingQuads();
            tessellator.setNormal(0.0F, 1.0F, 0.0F);
            renderer.renderFaceYPos(par1BlockHopper, 0.0D, -1.0D + d0, 0.0D, icon1);
            tessellator.draw();
        }
        else
        {
            renderer.renderFaceXPos(par1BlockHopper, par2 - 1.0F + f, par3, par4, icon);
            renderer.renderFaceXNeg(par1BlockHopper, par2 + 1.0F - f, par3, par4, icon);
            renderer.renderFaceZPos(par1BlockHopper, par2, par3, par4 - 1.0F + f, icon);
            renderer.renderFaceZNeg(par1BlockHopper, par2, par3, par4 + 1.0F - f, icon);
            renderer.renderFaceYPos(par1BlockHopper, par2, par3 - 1.0F + d0, par4, icon1);
        }

        renderer.setOverrideBlockTexture(icon);
        double d1 = 0.25D;
        double d2 = 0.25D;
        renderer.setRenderBounds(d1, d2, d1, 1.0D - d1, d0 - 0.002D, 1.0D - d1);

        if (par6)
        {
            tessellator.startDrawingQuads();
            tessellator.setNormal(1.0F, 0.0F, 0.0F);
            renderer.renderFaceXPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, icon);
            tessellator.draw();
            tessellator.startDrawingQuads();
            tessellator.setNormal(-1.0F, 0.0F, 0.0F);
            renderer.renderFaceXNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, icon);
            tessellator.draw();
            tessellator.startDrawingQuads();
            tessellator.setNormal(0.0F, 0.0F, 1.0F);
            renderer.renderFaceZPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, icon);
            tessellator.draw();
            tessellator.startDrawingQuads();
            tessellator.setNormal(0.0F, 0.0F, -1.0F);
            renderer.renderFaceZNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, icon);
            tessellator.draw();
            tessellator.startDrawingQuads();
            tessellator.setNormal(0.0F, 1.0F, 0.0F);
            renderer.renderFaceYPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, icon);
            tessellator.draw();
            tessellator.startDrawingQuads();
            tessellator.setNormal(0.0F, -1.0F, 0.0F);
            renderer.renderFaceYNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, icon);
            tessellator.draw();
        }
        else
        {
            renderer.renderStandardBlock(par1BlockHopper, par2, par3, par4);
        }
View Full Code Here

    private static final ResourceLocation bluegrass = new ResourceLocation("natura", "textures/misc/bluegrasscolor.png");
    private static final ResourceLocation orangegrass = new ResourceLocation("natura", "textures/misc/orangegrasscolor.png");

    public static void renderStandardInvBlock (RenderBlocks renderblocks, Block block, int meta)
    {
        Tessellator tessellator = Tessellator.instance;
        GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
        tessellator.startDrawingQuads();
        tessellator.setNormal(0.0F, -1F, 0.0F);
        renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta));
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.setNormal(0.0F, 1.0F, 0.0F);
        renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta));
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.setNormal(0.0F, 0.0F, -1F);
        renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta));
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.setNormal(0.0F, 0.0F, 1.0F);
        renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta));
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.setNormal(-1F, 0.0F, 0.0F);
        renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta));
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.setNormal(1.0F, 0.0F, 0.0F);
        renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta));
        tessellator.draw();
        GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    }
View Full Code Here

    @Override
    public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
    {
        if (modelID == berryModel)
        {
            Tessellator tessellator = Tessellator.instance;
            renderer.setRenderBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F);
            NProxyClient.renderStandardInvBlock(renderer, block, metadata);
        }
    }
View Full Code Here

        this.bindEntityTexture(par1EntityArrow);
        GL11.glPushMatrix();
        GL11.glTranslatef((float) par2, (float) par4, (float) par6);
        GL11.glRotatef(par1EntityArrow.prevRotationYaw + (par1EntityArrow.rotationYaw - par1EntityArrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(par1EntityArrow.prevRotationPitch + (par1EntityArrow.rotationPitch - par1EntityArrow.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F);
        Tessellator tessellator = Tessellator.instance;
        byte b0 = 0;
        float f2 = 0.0F;
        float f3 = 0.5F;
        float f4 = (0 + b0 * 10) / 32.0F;
        float f5 = (5 + b0 * 10) / 32.0F;
        float f6 = 0.0F;
        float f7 = 0.15625F;
        float f8 = (5 + b0 * 10) / 32.0F;
        float f9 = (10 + b0 * 10) / 32.0F;
        float f10 = 0.05625F;
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        float f11 = par1EntityArrow.arrowShake - par9;

        if (f11 > 0.0F)
        {
            float f12 = -MathHelper.sin(f11 * 3.0F) * f11;
            GL11.glRotatef(f12, 0.0F, 0.0F, 1.0F);
        }

        GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
        GL11.glScalef(f10, f10, f10);
        GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
        GL11.glNormal3f(f10, 0.0F, 0.0F);
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, f6, f8);
        tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, f7, f8);
        tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, f7, f9);
        tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, f6, f9);
        tessellator.draw();
        GL11.glNormal3f(-f10, 0.0F, 0.0F);
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, f6, f8);
        tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, f7, f8);
        tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, f7, f9);
        tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, f6, f9);
        tessellator.draw();

        for (int i = 0; i < 4; ++i)
        {
            GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
            GL11.glNormal3f(0.0F, 0.0F, f10);
            tessellator.startDrawingQuads();
            tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, f2, f4);
            tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, f3, f4);
            tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, f3, f5);
            tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, f2, f5);
            tessellator.draw();
        }

        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        GL11.glPopMatrix();
    }
View Full Code Here

TOP

Related Classes of net.minecraft.client.renderer.Tessellator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.