Java 类net.minecraft.client.renderer.chunk.CompiledChunk 实例源码

项目:DecompiledMinecraft    文件:RenderGlobal.java   
/**
 * Gets the render info for use on the Debug screen
 */
public String getDebugInfoRenders()
{
    int i = this.viewFrustum.renderChunks.length;
    int j = 0;

    for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.renderInfos)
    {
        CompiledChunk compiledchunk = renderglobal$containerlocalrenderinformation.renderChunk.compiledChunk;

        if (compiledchunk != CompiledChunk.DUMMY && !compiledchunk.isEmpty())
        {
            ++j;
        }
    }

    return String.format("C: %d/%d %sD: %d, %s", new Object[] {Integer.valueOf(j), Integer.valueOf(i), this.mc.renderChunksMany ? "(s) " : "", Integer.valueOf(this.renderDistanceChunks), this.renderDispatcher.getDebugInfo()});
}
项目:BaseClient    文件:DynamicLight.java   
private void updateChunkLight(RenderChunk p_updateChunkLight_1_, Set<BlockPos> p_updateChunkLight_2_, Set<BlockPos> p_updateChunkLight_3_)
{
    if (p_updateChunkLight_1_ != null)
    {
        CompiledChunk compiledchunk = p_updateChunkLight_1_.getCompiledChunk();

        if (compiledchunk != null && !compiledchunk.isEmpty())
        {
            p_updateChunkLight_1_.setNeedsUpdate(true);
        }

        BlockPos blockpos = p_updateChunkLight_1_.getPosition();

        if (p_updateChunkLight_2_ != null)
        {
            p_updateChunkLight_2_.remove(blockpos);
        }

        if (p_updateChunkLight_3_ != null)
        {
            p_updateChunkLight_3_.add(blockpos);
        }
    }
}
项目:BaseClient    文件:RenderGlobal.java   
/**
 * Gets the render info for use on the Debug screen
 */
public String getDebugInfoRenders()
{
    int i = this.viewFrustum.renderChunks.length;
    int j = 0;

    for (Object renderglobal$containerlocalrenderinformation0 : this.renderInfos)
    {
        RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = (RenderGlobal.ContainerLocalRenderInformation) renderglobal$containerlocalrenderinformation0;
        CompiledChunk compiledchunk = renderglobal$containerlocalrenderinformation.renderChunk.compiledChunk;

        if (compiledchunk != CompiledChunk.DUMMY && !compiledchunk.isEmpty())
        {
            ++j;
        }
    }

    return String.format("C: %d/%d %sD: %d, %s", new Object[] {Integer.valueOf(j), Integer.valueOf(i), this.mc.renderChunksMany ? "(s) " : "", Integer.valueOf(this.renderDistanceChunks), this.renderDispatcher.getDebugInfo()});
}
项目:BaseClient    文件:RenderGlobal.java   
/**
 * Gets the render info for use on the Debug screen
 */
public String getDebugInfoRenders()
{
    int i = this.viewFrustum.renderChunks.length;
    int j = 0;

    for (Object renderglobal$containerlocalrenderinformation0 : this.renderInfos)
    {
        RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = (RenderGlobal.ContainerLocalRenderInformation) renderglobal$containerlocalrenderinformation0;
        CompiledChunk compiledchunk = renderglobal$containerlocalrenderinformation.renderChunk.compiledChunk;

        if (compiledchunk != CompiledChunk.DUMMY && !compiledchunk.isEmpty())
        {
            ++j;
        }
    }

    return String.format("C: %d/%d %sD: %d, %s", new Object[] {Integer.valueOf(j), Integer.valueOf(i), this.mc.renderChunksMany ? "(s) " : "", Integer.valueOf(this.renderDistanceChunks), this.renderDispatcher.getDebugInfo()});
}
项目:Backmemed    文件:RenderGlobal.java   
protected int getRenderedChunks()
{
    int i = 0;

    for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.renderInfos)
    {
        CompiledChunk compiledchunk = renderglobal$containerlocalrenderinformation.renderChunk.compiledChunk;

        if (compiledchunk != CompiledChunk.DUMMY && !compiledchunk.isEmpty())
        {
            ++i;
        }
    }

    return i;
}
项目:Backmemed    文件:DynamicLight.java   
private void updateChunkLight(RenderChunk p_updateChunkLight_1_, Set<BlockPos> p_updateChunkLight_2_, Set<BlockPos> p_updateChunkLight_3_)
{
    if (p_updateChunkLight_1_ != null)
    {
        CompiledChunk compiledchunk = p_updateChunkLight_1_.getCompiledChunk();

        if (compiledchunk != null && !compiledchunk.isEmpty())
        {
            p_updateChunkLight_1_.setNeedsUpdate(false);
        }

        BlockPos blockpos = p_updateChunkLight_1_.getPosition().toImmutable();

        if (p_updateChunkLight_2_ != null)
        {
            p_updateChunkLight_2_.remove(blockpos);
        }

        if (p_updateChunkLight_3_ != null)
        {
            p_updateChunkLight_3_.add(blockpos);
        }
    }
}
项目:CustomWorldGen    文件:RenderGlobal.java   
protected int getRenderedChunks()
{
    int i = 0;

    for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.renderInfos)
    {
        CompiledChunk compiledchunk = renderglobal$containerlocalrenderinformation.renderChunk.compiledChunk;

        if (compiledchunk != CompiledChunk.DUMMY && !compiledchunk.isEmpty())
        {
            ++i;
        }
    }

    return i;
}
项目:ExpandedRailsMod    文件:RenderGlobal.java   
protected int getRenderedChunks()
{
    int i = 0;

    for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.renderInfos)
    {
        CompiledChunk compiledchunk = renderglobal$containerlocalrenderinformation.renderChunk.compiledChunk;

        if (compiledchunk != CompiledChunk.DUMMY && !compiledchunk.isEmpty())
        {
            ++i;
        }
    }

    return i;
}
项目:blockbuster    文件:CommandLoadChunks.java   
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
    RenderGlobal render = Minecraft.getMinecraft().renderGlobal;
    Field frustumField = null;
    Field chunkyField = null;

    /* Find all fields */
    for (Field field : render.getClass().getDeclaredFields())
    {
        if (chunkyField == null && field.getType().equals(ChunkRenderDispatcher.class))
        {
            chunkyField = field;
            chunkyField.setAccessible(true);
        }

        if (frustumField == null && field.getType().equals(ViewFrustum.class))
        {
            frustumField = field;
            frustumField.setAccessible(true);
        }

        if (chunkyField != null && frustumField != null)
        {
            break;
        }
    }

    /* Force chunk loading */
    if (chunkyField != null && frustumField != null)
    {
        try
        {
            ChunkRenderDispatcher chunks = (ChunkRenderDispatcher) chunkyField.get(render);
            ViewFrustum frustum = (ViewFrustum) frustumField.get(render);

            for (RenderChunk chunk : frustum.renderChunks)
            {
                boolean isDummy = chunk.getCompiledChunk() == CompiledChunk.DUMMY;

                if (isDummy)
                {
                    chunks.updateChunkNow(chunk);
                }
            }

            L10n.info(sender, "commands.load_chunks");
        }
        catch (Exception e)
        {
            e.printStackTrace();

            L10n.error(sender, "commands.load_chunks");
        }
    }
}
项目:Blocksteps    文件:ListedRenderChunkBlocksteps.java   
@Override
public void rebuildChunk(float x, float y, float z, ChunkCompileTaskGenerator generator)
{
    CompiledChunk compiledchunk = new CompiledChunk();
    BlockPos blockpos = this.position;
    BlockPos blockpos1 = blockpos.add(15, 15, 15);
    generator.getLock().lock();
    RegionRenderCache regionrendercache;

    try
    {
        if (generator.getStatus() != ChunkCompileTaskGenerator.Status.COMPILING)
        {
            return;
        }

        regionrendercache = new RegionRenderCacheBlocksteps(this.world, blockpos.add(-1, -1, -1), blockpos1.add(1, 1, 1), 1);
        generator.setCompiledChunk(compiledchunk);
    }
    finally
    {
        generator.getLock().unlock();
    }

    VisGraph visgraph = new VisGraph();

    Minecraft mc = Minecraft.getMinecraft();

    if (!regionrendercache.extendedLevelsInChunkCache())
    {
        ++renderChunksUpdated;
        Iterator iterator = BlockPos.getAllInBoxMutable(blockpos, blockpos1).iterator();

        while (iterator.hasNext())
        {
            BlockPos.MutableBlockPos mutableblockpos = (BlockPos.MutableBlockPos)iterator.next();
            IBlockState iblockstate = regionrendercache.getBlockState(mutableblockpos);
            Block block = iblockstate.getBlock();

            if(Blocksteps.config.mapType == 2)
            {
                synchronized(Blocksteps.eventHandler.threadCrawlBlocks.surface)
                {
                    renderBlock(mutableblockpos, iblockstate, block, visgraph, regionrendercache, generator, compiledchunk, blockpos, mc);
                }
            }
            else
            {
                renderBlock(mutableblockpos, iblockstate, block, visgraph, regionrendercache, generator, compiledchunk, blockpos, mc);
            }
        }

        BlockRenderLayer[] aenumworldblocklayer = BlockRenderLayer.values();
        int j = aenumworldblocklayer.length;

        for (int k = 0; k < j; ++k)
        {
            BlockRenderLayer enumworldblocklayer = aenumworldblocklayer[k];

            if (compiledchunk.isLayerStarted(enumworldblocklayer))
            {
                this.postRenderBlocks(enumworldblocklayer, x, y, z, generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(enumworldblocklayer), compiledchunk);
            }
        }
    }

    compiledchunk.setVisibility(visgraph.computeVisibility());
}
项目:Blocksteps    文件:ListedRenderChunkBlocksteps.java   
public void renderBlock(BlockPos.MutableBlockPos mutableblockpos, IBlockState iblockstate, Block block, VisGraph visgraph, RegionRenderCache regionrendercache, ChunkCompileTaskGenerator generator, CompiledChunk compiledchunk, BlockPos blockpos, Minecraft mc)
{
    boolean hasBlock = ChunkStore.contains(mutableblockpos) || Blocksteps.config.mapType == 3 || Blocksteps.config.mapType == 4;

    if (block.isOpaqueCube())
    {
        visgraph.func_178606_a(mutableblockpos);
    }

    if (hasBlock && block.hasTileEntity(iblockstate))
    {
        TileEntity tileentity = regionrendercache.getTileEntity(new BlockPos(mutableblockpos));

        if (tileentity != null && TileEntityRendererDispatcher.instance.hasSpecialRenderer(tileentity))
        {
            compiledchunk.addTileEntity(tileentity);
        }
    }

    for(BlockRenderLayer enumworldblocklayer1 : BlockRenderLayer.values()) {
        if(!block.canRenderInLayer(enumworldblocklayer1)) continue;
        net.minecraftforge.client.ForgeHooksClient.setRenderLayer(enumworldblocklayer1);
        int i = enumworldblocklayer1.ordinal();

        if (block.getDefaultState().getRenderType() != EnumBlockRenderType.INVISIBLE)
        {
            WorldRenderer worldrenderer = generator.getRegionRenderCacheBuilder().getWorldRendererByLayerId(i);

            if (!compiledchunk.isLayerStarted(enumworldblocklayer1))
            {
                compiledchunk.setLayerStarted(enumworldblocklayer1);
                this.preRenderBlocks(worldrenderer, blockpos);
            }

            if (hasBlock && mc.getBlockRendererDispatcher().renderBlock(iblockstate, mutableblockpos, regionrendercache, worldrenderer))
            {
                compiledchunk.setLayerUsed(enumworldblocklayer1);
            }
        }
    }
}