Package net.minecraft.client.renderer

Examples of net.minecraft.client.renderer.RenderBlocks


  @SuppressWarnings("deprecation")
  @Override
  public void renderItem(ItemRenderType type, ItemStack item, Object... data)
  {
    RenderEngine renderEngine = Minecraft.getMinecraft().renderEngine;
    RenderBlocks renderer = (RenderBlocks)data[0];

    BlockFactoryGlassPane pane = (BlockFactoryGlassPane)Block.blocksList[((ItemBlock)item.getItem()).getBlockID()];

    GL11.glPushMatrix();
    GL11.glDisable(GL11.GL_CULL_FACE);
View Full Code Here


      { 0.7F, 0.1F, 0.3F }, { 0.3F, 0.1F, 0.7F }, { 0.7F, 0.1F, 0.7F }, { 0.5F, 0.32F, 0.5F }, };

  public TileEntityColoniesChestRenderer() {
    model = new ModelChest();
    random = new Random();
    renderBlocks = new RenderBlocks();
  }
View Full Code Here

        logger.info(String.format("Loaded %s [w:%d,h:%d,l:%d]", new Object[] {
            filename, this.schematic.width(), this.schematic.height(), this.schematic.length()
        }));

        this.renderBlocks = new RenderBlocks(this.schematic);
        this.rendererTileEntity = new RendererTileEntity(this.schematic);

        createRendererSchematicChunk();

        this.isRenderingSchematic = true;
View Full Code Here

    this.profiler.endSection();
  }

  public void renderBlocks(int renderPass, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) {
    IBlockAccess mcWorld = this.settings.mcWorldCache;
    RenderBlocks renderBlocks = this.settings.renderBlocks;

    int x, y, z;
    int blockId = 0, mcBlockId = 0;
    int sides = 0;
    Block block = null;
    String lastTexture = "";
    Vector3i tmp;

    boolean ambientOcclusion = this.settings.minecraft.gameSettings.ambientOcclusion;
    this.settings.minecraft.gameSettings.ambientOcclusion = false;

    Tessellator.instance.startDrawingQuads();

    for (y = minY; y < maxY; y++) {
      for (z = minZ; z < maxZ; z++) {
        for (x = minX; x < maxX; x++) {
          try {
            blockId = this.schematic.getBlockId(x, y, z);
            block = Block.blocksList[blockId];

            mcBlockId = mcWorld.getBlockId(x + this.settings.offset.x, y + this.settings.offset.y, z + this.settings.offset.z);

            sides = 0;
            if (block != null) {
              if (block.shouldSideBeRendered(this.schematic, x, y - 1, z, 0)) {
                sides |= 0x01;
              }

              if (block.shouldSideBeRendered(this.schematic, x, y + 1, z, 1)) {
                sides |= 0x02;
              }

              if (block.shouldSideBeRendered(this.schematic, x, y, z - 1, 2)) {
                sides |= 0x04;
              }

              if (block.shouldSideBeRendered(this.schematic, x, y, z + 1, 3)) {
                sides |= 0x08;
              }

              if (block.shouldSideBeRendered(this.schematic, x - 1, y, z, 4)) {
                sides |= 0x10;
              }

              if (block.shouldSideBeRendered(this.schematic, x + 1, y, z, 5)) {
                sides |= 0x20;
              }
            }

            if (mcBlockId != 0) {
              if (this.settings.highlight && renderPass == 2) {
                if (blockId == 0 && this.settings.highlightAir) {
                  tmp = new Vector3i(x, y, z);
                  drawCuboidSurface(tmp, tmp.clone().add(1), 0x3F, 0.75f, 0.0f, 0.75f, 0.25f);
                  drawCuboidOutline(tmp, tmp.clone().add(1), 0x3F, 0.75f, 0.0f, 0.75f, 0.25f);
                } else if (blockId != mcBlockId) {
                  tmp = new Vector3i(x, y, z);
                  drawCuboidSurface(tmp, tmp.clone().add(1), sides, 1.0f, 0.0f, 0.0f, 0.25f);
                  drawCuboidOutline(tmp, tmp.clone().add(1), sides, 1.0f, 0.0f, 0.0f, 0.25f);
                } else if (this.schematic.getBlockMetadata(x, y, z) != mcWorld.getBlockMetadata(x + this.settings.offset.x, y + this.settings.offset.y, z + this.settings.offset.z)) {
                  tmp = new Vector3i(x, y, z);
                  drawCuboidSurface(tmp, tmp.clone().add(1), sides, 0.75f, 0.35f, 0.0f, 0.25f);
                  drawCuboidOutline(tmp, tmp.clone().add(1), sides, 0.75f, 0.35f, 0.0f, 0.25f);
                }
              }
            } else if (mcBlockId == 0 && blockId > 0 && blockId < 0x1000) {
              if (this.settings.highlight && renderPass == 2) {
                tmp = new Vector3i(x, y, z);
                drawCuboidSurface(tmp, tmp.clone().add(1), sides, 0.0f, 0.75f, 1.0f, 0.25f);
                drawCuboidOutline(tmp, tmp.clone().add(1), sides, 0.0f, 0.75f, 1.0f, 0.25f);
              }

              if (block != null) {
                if (!lastTexture.equals(block.getTextureFile())) {
                  ForgeHooksClient.bindTexture(getTextureName(block.getTextureFile()), 0);
                  lastTexture = block.getTextureFile();
                }

                if (block.canRenderInPass(renderPass)) {
                  renderBlocks.renderBlockByRenderType(block, x, y, z);
                }
              }
            }
          } catch (Exception e) {
            Settings.logger.log(e);
View Full Code Here

   
    @Override
    public boolean renderStatic(Vector3 pos, int pass)
    {
        if(pass == 0) {
            new RenderBlocks(new PartMetaAccess(this)).renderBlockByRenderType(getBlock(), x(), y(), z());
            return true;
        }
        return false;
    }
View Full Code Here

  }

  @Override
  public void renderItem(ItemRenderType type, ItemStack item, Object... data)
  {
    RenderBlocks renderBlocks = (RenderBlocks)data[0];

    if(type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON)
    {
      GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    }
View Full Code Here

        Colour colour = item.getColorFromItemStack(itemStack);
        Colour glow = item.getColorFromItemStack(itemStack);
        switch (type) {
            case ENTITY:
                RenderBlocks renderEntity = (RenderBlocks) data[0];
                EntityItem entityEntity = (EntityItem) data[1];
                model.setNeutralPose();

                model.render(null, 1, false, colour, glow);
                break;
            case INVENTORY:
                RenderBlocks renderInventory = (RenderBlocks) data[0];
                MuseIconUtils.drawIconAt(0, 0, MPSItems.powerTool().getIconIndex(itemStack), colour);
                break;
            case EQUIPPED:
                RenderBlocks renderEquipped = (RenderBlocks) data[0];
                EntityLivingBase entityEquipped = (EntityLivingBase) data[1];

                if (entityEquipped instanceof EntityPlayer) {
                    model.setPoseForPlayer((EntityPlayer) entityEquipped, itemStack);
                } else {
                    model.setNeutralPose();
                }

                model.render(entityEquipped, 1, false, colour, glow);
                break;
            case FIRST_PERSON_MAP:
                EntityPlayer playerFirstPerson = (EntityPlayer) data[0];
                TextureManager engineFirstPerson = (TextureManager) data[1];
                MapData mapDataFirstPerson = (MapData) data[2];
                model.setPoseForPlayer(playerFirstPerson, itemStack);

                model.render(playerFirstPerson, 1, true, colour, glow);
                break;
            case EQUIPPED_FIRST_PERSON:
                RenderBlocks renderEquFP = (RenderBlocks) data[0];
                EntityLivingBase entityEquFP = (EntityLivingBase) data[1];
                if (entityEquFP instanceof EntityPlayer) {
                    model.setPoseForPlayer((EntityPlayer) entityEquFP, itemStack);
                } else {
                    model.setNeutralPose();
View Full Code Here

  {
    //Avoid any broken cases by returning
    if(!(item.getItem() instanceof ItemGun))
      return;
   
    RenderBlocks renderBlocks = (RenderBlocks)data[0];
   
   
    GunType gunType = ((ItemGun)item.getItem()).type;
    if(gunType == null)
      return;
View Full Code Here

  }

    @Override
  public void func_147496_a(World par1World)
    {
        blockRenderer = new RenderBlocks(par1World);
    }
View Full Code Here

 
  @Override
  public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    int color = item.getItem().getColorFromItemStack(item, 0);
    RenderUtils.setColorFromInt(color);
    RenderBlocks render = RenderBlocks.getInstance();
    render.useInventoryTint = false;
    if ((type == ItemRenderType.EQUIPPED) ||
        (type == ItemRenderType.EQUIPPED_FIRST_PERSON))
      GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    render.renderBlockAsItem(block, item.getItemDamage(), 1.0F);
    render.useInventoryTint = true;
  }
View Full Code Here

TOP

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

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.