Examples of Tessellator


Examples of net.minecraft.client.renderer.Tessellator

    return gw < finalGw || gh < finalGh;
  }

  private void drawRect(int width, int height, float r, float g,
      float b, float a) {
    Tessellator tessellator = Tessellator.instance;
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glColor4f(r, g, b, a);
    tessellator.startDrawingQuads();
    tessellator.addVertex(0.0D, height, 0.0D);
    tessellator.addVertex(width, height, 0.0D);
    tessellator.addVertex(width, 0.0D, 0.0D);
    tessellator.addVertex(0.0D, 0.0D, 0.0D);
    tessellator.draw();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

    return renderWorldBlock(world, x, y, z, block, modelId, renderer, meta);
  }
 

  public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer, int meta) {
    Tessellator tes = Tessellator.instance;
    tes.addTranslation(x, y, z);
    tes.setColorOpaque_F(1, 1, 1);
   
    int brightness;
    if(world == null) {
      brightness = 15 << 20 | 15 << 4;
    } else {
      brightness = world.getLightBrightnessForSkyBlocks(x, y, z, 0);
    }
    tes.setBrightness(brightness);
   

    IIcon[] icons = new IIcon[6];
    for(int i=0;i<icons.length;i++) {     
      icons[i] = block.getIcon(i, meta);             
    }
   
    float yaw = 180;
    if(world != null) {
      TileEntity te = world.getTileEntity(x, y, z);
      if(te instanceof TileEndermanSkull) {
        yaw = ((TileEndermanSkull)te).yaw;
      }
    }
   
    VertexRotation rot = new VertexRotation(Math.toRadians(yaw), new Vector3d(0,1,0), new Vector3d(0.5,0,0.5));
   
    float size = 0.25f;
    float height = 0.5f;
    BoundingBox bb = new BoundingBox(size, 0, size, 1 - size, height, 1 - size);
    CubeRenderer.render(bb, icons, rot, true);
   
    if(meta > 1) {
      renderBolts(rot, size);
    }
   
   
    tes.addTranslation(-x, -y, -z);

    return true;
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

public class RenderHelperMonitorStorageFluid extends RenderHelper
{

  public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
  {
    Tessellator tessellator = Tessellator.instance;
    block.setBlockBoundsForItemRender();
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);

    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    tessellator.addTranslation(0.0F, 0.0F, 0.0F);
    renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, metadata));
    tessellator.addTranslation(0.0F, 0.0F, 0.0F);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    tessellator.addTranslation(0.0F, 0.0F, 0.0F);
    renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, metadata));
    tessellator.addTranslation(0.0F, 0.0F, 0.0F);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    tessellator.addTranslation(0.0F, 0.0F, 0.0F);

    tessellator.setBrightness(15 << 20 | 15 << 6);
    tessellator.setColorRGBA_I(0xFFFFFF, 0xFF);
    int[] color =
    { 0x1B2344, 0x895CA8, 0xDABDEF };
    BlockMonitorStorageFluid terminal = (BlockMonitorStorageFluid) block;
    renderer.renderFaceXNeg(block, 0, 0, 0, terminal.baseLayer);
    for (int i = 0; i < 3; i++)
    {
      tessellator.setColorRGBA_I(color[i], 0xFF);
      renderer.renderFaceXNeg(block, 0, 0, 0, terminal.colorLayers[i]);
    }

    tessellator.addTranslation(0.0F, 0.0F, 0.0F);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    tessellator.addTranslation(0.0F, 0.0F, 0.0F);
    renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, metadata));
    tessellator.addTranslation(0.0F, 0.0F, 0.0F);
    tessellator.draw();

    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

  }

  public void renderOuterBlock(Block block, int x, int y, int z, RenderBlocks renderer, IBlockAccess world)
  {

    Tessellator tessellator = Tessellator.instance;
    boolean tankUp = world.getBlockTileEntity(x, y + 1, z) instanceof TileEntityCertusTank;
    boolean tankDown = world.getBlockTileEntity(x, y - 1, z) instanceof TileEntityCertusTank;
    int meta = 0;
    if (tankUp && tankDown)
      meta = 3;
    else if (tankUp)
      meta = 2;
    else if (tankDown)
      meta = 1;
    if (!tankDown)
    {
      tessellator.setNormal(0.0F, -1F, 0.0F);
      renderer.renderFaceYNeg(block, x, y, z, block.getIcon(0, 0));
    }
    if (!(tankUp))
    {
      tessellator.setNormal(0.0F, 1.0F, 0.0F);
      renderer.renderFaceYPos(block, x, y, z, block.getIcon(1, 0));
    }

    Icon sideIcon = block.getIcon(3, meta);
    tessellator.setNormal(0.0F, 0.0F, -1F);
    renderer.renderFaceZNeg(block, x, y, z, sideIcon);
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(block, x, y, z, sideIcon);
    tessellator.setNormal(-1F, 0.0F, 0.0F);
    renderer.renderFaceXNeg(block, x, y, z, sideIcon);
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    renderer.renderFaceXPos(block, x, y, z, sideIcon);

  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

  }

  public void renderInnerBlock(Block block, int x, int y, int z, RenderBlocks renderer, IBlockAccess world)
  {
    Tessellator tessellator = Tessellator.instance;
    boolean tankUp = world.getBlockTileEntity(x, y + 1, z) instanceof TileEntityCertusTank;
    boolean tankDown = world.getBlockTileEntity(x, y - 1, z) instanceof TileEntityCertusTank;
    int meta = 0;
    if (tankUp && tankDown)
      meta = 3;
    else if (tankUp)
      meta = 2;
    else if (tankDown)
      meta = 1;
    if (!tankDown)
    {
      tessellator.setNormal(0.0F, -1F, 0.0F);
      renderer.renderFaceYNeg(block, x, y + 0.001D, z, block.getIcon(0, 0));
    }
    if (!(tankUp))
    {
      tessellator.setNormal(0.0F, 1.0F, 0.0F);
      renderer.renderFaceYPos(block, x, y - 0.001D, z, block.getIcon(1, 0));
    }
    Icon sideIcon = block.getIcon(3, meta);
    tessellator.setNormal(0.0F, 0.0F, -1F);
    renderer.renderFaceZNeg(block, x, y, z + 0.001D, sideIcon);
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(block, x, y, z - 0.001D, sideIcon);
    tessellator.setNormal(-1F, 0.0F, 0.0F);
    renderer.renderFaceXNeg(block, x + 0.001D, y, z, sideIcon);
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    renderer.renderFaceXPos(block, x - 0.001D, y, z, sideIcon);

  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

  }

  public void renderFluid(TileEntity tileEntity, double x, double y, double z, RenderBlocks renderer)
  {
    Tessellator tessellator = Tessellator.instance;
    tessellator.setColorOpaque(255, 255, 255);
    if (tileEntity != null && ((TileEntityCertusTank) tileEntity).getTankInfo(ForgeDirection.UNKNOWN)[0].fluid != null)
    {
      Fluid storedFluid = ((TileEntityCertusTank) tileEntity).getRenderFluid();
      float scale = ((TileEntityCertusTank) tileEntity).getRenderScale();
      if (storedFluid != null && scale > 0)
      {
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        Block id = Block.blocksList[FluidRegistry.WATER.getBlockID()];
        Icon fluidIcon = storedFluid.getIcon();
        if (fluidIcon == null)
          fluidIcon = FluidRegistry.LAVA.getIcon();
        renderer.setRenderBounds(0.08F, 0.001F, 0.08F, 0.92, scale * 0.999F, 0.92F);
        tessellator.setNormal(0.0F, -1F, 0.0F);
        renderer.renderFaceYNeg(id, x, y, z, fluidIcon);
        tessellator.setNormal(0.0F, 1.0F, 0.0F);
        renderer.renderFaceYPos(id, x, y, z, fluidIcon);
        tessellator.setNormal(0.0F, 0.0F, -1F);
        renderer.renderFaceZNeg(id, x, y, z, fluidIcon);
        tessellator.setNormal(0.0F, 0.0F, 1.0F);
        renderer.renderFaceZPos(id, x, y, z, fluidIcon);
        tessellator.setNormal(-1F, 0.0F, 0.0F);
        renderer.renderFaceXNeg(id, x, y, z, fluidIcon);
        tessellator.setNormal(1.0F, 0.0F, 0.0F);
        renderer.renderFaceXPos(id, x, y, z, fluidIcon);
      }
    }
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

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

  public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
  {
    Tessellator ts = Tessellator.instance;
    ts.setColorOpaque_I(0xFFFFFF);
    ForgeDirection face = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z));
    renderer.renderStandardBlock(block, x, y, z);
    BlockMonitorStorageFluid monitorBlock = (BlockMonitorStorageFluid) block;
    int[] color =
    { 0, 0, 0 };
    TileEntity blockTE = world.getBlockTileEntity(x, y, z);
    if (blockTE instanceof TileEntityMonitorStorageFluid)
    {
      TileEntityMonitorStorageFluid monitorTE = (TileEntityMonitorStorageFluid) blockTE;
      switch (monitorTE.getColor())
      {
      case -1:
        color = fluix.clone();
        break;
      case 0:
        color = blue.clone();
        break;
      case 1:
        color = black.clone();
        break;
      case 2:
        color = white.clone();
        break;
      case 3:
        color = brown.clone();
        break;
      case 4:
        color = red.clone();
        break;
      case 5:
        color = yellow.clone();
        break;
      case 6:
        color = green.clone();
        break;
      }

      boolean active = monitorTE.isMachineActive();
      ts.setBrightness(15 << 2 | 15 << 0);
      if (active)
        ts.setBrightness(15 << 20 | 15 << 4);

      for (int i = 0; i < 3; i++)
      {
        ts.setColorOpaque_I(color[i]);
        drawFace(face, block, x, y, z, monitorBlock.colorLayers[i], renderer);
      }
    }
    return true;
  }
View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

      if (storedFluid != null && storedFluid.getFluid() != null)
      {
        Icon fluidIcon = storedFluid.getFluid().getIcon();

        Tessellator tessellator = Tessellator.instance;
        RenderBlocks renderer = new RenderBlocks();

        GL11.glScalef(1.0F, 1.0F, -1.0F);
        renderer.setRenderBounds(0.08F, 0.001F, 0.08F, 0.92, (float) storedFluid.amount / (float) tankCapacity * 0.999F, 0.92F);
        Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
        GL11.glTranslatef(-0.5F, -0.5F, -0.5F);

        GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

        tessellator.startDrawingQuads();
        tessellator.setNormal(0.0F, -1F, 0.0F);
        renderer.renderFaceYNeg(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon);
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.setNormal(0.0F, 1.0F, 0.0F);
        renderer.renderFaceYPos(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon);
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.setNormal(0.0F, 0.0F, -1F);
        renderer.renderFaceZNeg(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon);
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.setNormal(0.0F, 0.0F, 1.0F);
        renderer.renderFaceZPos(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon);
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.setNormal(-1F, 0.0F, 0.0F);
        renderer.renderFaceXNeg(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon);
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.setNormal(1.0F, 0.0F, 0.0F);
        renderer.renderFaceXPos(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon);
        tessellator.draw();

        GL11.glPopAttrib();
      }
    }

View Full Code Here

Examples of net.minecraft.client.renderer.Tessellator

      TileEntityMonitorStorageFluid TE = (TileEntityMonitorStorageFluid) tileentity;
      if (TE.isMachineActive())
      {
        GL11.glTranslated(-8.6F, -16.3, -1.2F);
        Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
        Tessellator cake = Tessellator.instance;
        cake.startDrawingQuads();
        cake.setBrightness(255);
        cake.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f);
        cake.addVertexWithUV(0, 16, 0, fluidIcon.getMinU(), fluidIcon.getMaxV());
        cake.addVertexWithUV(16, 16, 0, fluidIcon.getMaxU(), fluidIcon.getMaxV());
        cake.addVertexWithUV(16, 0, 0, fluidIcon.getMaxU(), fluidIcon.getMinV());
        cake.addVertexWithUV(0, 0, 0, fluidIcon.getMinU(), fluidIcon.getMinV());
        cake.draw();

        int width = fr.getStringWidth(msg);
        GL11.glTranslatef(8.25F - 0.5F * width, 24.0F, 0);
        GL11.glScaled(1, 0.5, 1);
        fr.drawString(msg, 0, 0, 0x00FFFF);
View Full Code Here

Examples of net.minecraft.src.Tessellator

    Tessellator getTessellator(int texture) {
        if (texture == CTMUtils.terrainTexture) {
            return this;
        }
        Tessellator newTessellator = children.get(texture);
        if (newTessellator == null) {
            logger.finer("new tessellator for texture %d", texture);
            if (isForge) {
                newTessellator = new Tessellator();
            } else {
                newTessellator = new Tessellator(Math.max(bufferSize / 16, 131072));
            }
            newTessellator.texture = texture;
            copyFields(newTessellator, true);
            children.put(texture, newTessellator);
        } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.