Package net.minecraft.world

Examples of net.minecraft.world.IBlockAccess


    Block srcBlk = te.getSourceBlock();
    if(srcBlk == null) {
      srcBlk = Blocks.glowstone;
    }

    IBlockAccess origBa = rb.blockAccess;
    rb.blockAccess = new PaintedBlockAccessWrapper(origBa);
    rb.renderBlockByRenderType(srcBlk, x, y, z);
    rb.blockAccess = origBa;

    return true;
View Full Code Here


    Block srcBlk = te.getSourceBlock();
    if(srcBlk == null) {
      srcBlk = defaultBlock;
    }

    IBlockAccess origBa = rb.blockAccess;
    try {     
      rb.blockAccess = new PaintedBlockAccessWrapper(origBa);
      if(srcBlk == block) {
        rb.renderStandardBlock(srcBlk, x, y, z);
      } else {
View Full Code Here

       
      } else if(facadeId != null){
        bundle.setFacadeRenderAs(FacadeRenderState.FULL);
        res = false;
       
        IBlockAccess origBa = rb.blockAccess;
        rb.blockAccess = new FacadeAccessWrapper(origBa);
        try {
          rb.renderBlockByRenderType(facadeId, x, y, z);
        } catch(Exception e) {
          //just in case the paint source wont render safely in this way
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);
                }
              }
View Full Code Here

    this.settings.minecraft.gameSettings.ambientOcclusion = ambientOcclusion;
  }

  public void renderTileEntities(int renderPass) {
    IBlockAccess mcWorld = this.settings.mcWorldCache;
    RendererTileEntity rendererTileEntity = this.settings.rendererTileEntity;

    int x, y, z;
    int mcBlockId = 0;

    GL11.glColor4f(1.0f, 1.0f, 1.0f, this.settings.alpha);

    try {
      for (TileEntity tileEntity : this.tileEntities) {
        x = tileEntity.xCoord;
        y = tileEntity.yCoord;
        z = tileEntity.zCoord;

        if (this.settings.renderingLayer >= 0) {
          if (y != this.settings.renderingLayer) {
            continue;
          }
        }

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

        if (mcBlockId == 0) {
          if (tileEntity instanceof TileEntitySign) {
            rendererTileEntity.renderTileEntitySignAt((TileEntitySign) tileEntity);
          } else if (tileEntity instanceof TileEntityChest) {
View Full Code Here

    }

    @Override
    public void drawBreaking(RenderBlocks renderBlocks)
    {
        IBlockAccess actual = renderBlocks.blockAccess;
        renderBlocks.blockAccess = new PartMetaAccess(this);
        renderBlocks.renderBlockLever(lever, x(), y(), z());
        renderBlocks.blockAccess = actual;
    }
View Full Code Here

        int baseY = (int)Math.floor(player.posY) - blockTrackRange + blockTrackRange * (ticksExisted % updateInterval) / (updateInterval / 2);
        int maxY = (int)Math.floor(player.posY) - blockTrackRange + blockTrackRange * (ticksExisted % updateInterval + 1) / (updateInterval / 2);
        baseY = MathHelper.clamp_int(baseY, 0, 255);
        maxY = MathHelper.clamp_int(maxY, 0, 255);
        int baseZ = (int)Math.floor(player.posZ) - blockTrackRange;
        IBlockAccess chunkCache = new ChunkCache(player.worldObj, baseX, baseY, baseZ, baseX + 2 * blockTrackRange, maxY, baseZ + 2 * blockTrackRange, 0);
        for(int i = baseX; i <= baseX + 2 * blockTrackRange; i++) {
            for(int j = baseY; j < maxY; j++) {
                for(int k = baseZ; k <= baseZ + 2 * blockTrackRange; k++) {
                    if(player.getDistance(i, j, k) > blockTrackRange) continue;
                    TileEntity te = chunkCache.getTileEntity(i, j, k);
                    if(searchHandler != null && te instanceof IInventory) {
                        searchHandler.checkInventoryForItems(te);
                    }
                    List<IBlockTrackEntry> entries = BlockTrackEntryList.instance.getEntriesForCoordinate(chunkCache, i, j, k);
                    if(entries.isEmpty()) continue;
View Full Code Here

TOP

Related Classes of net.minecraft.world.IBlockAccess

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.