当前位置: 首页>>代码示例>>Java>>正文


Java RegionRenderCache类代码示例

本文整理汇总了Java中net.minecraft.client.renderer.RegionRenderCache的典型用法代码示例。如果您正苦于以下问题:Java RegionRenderCache类的具体用法?Java RegionRenderCache怎么用?Java RegionRenderCache使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RegionRenderCache类属于net.minecraft.client.renderer包,在下文中一共展示了RegionRenderCache类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRegionRenderCache

import net.minecraft.client.renderer.RegionRenderCache; //导入依赖的package包/类
protected RegionRenderCache createRegionRenderCache(World p_createRegionRenderCache_1_, BlockPos p_createRegionRenderCache_2_, BlockPos p_createRegionRenderCache_3_, int p_createRegionRenderCache_4_)
{
    return new RegionRenderCache(p_createRegionRenderCache_1_, p_createRegionRenderCache_2_, p_createRegionRenderCache_3_, p_createRegionRenderCache_4_);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:5,代码来源:RenderChunk.java

示例2: rebuildChunk

import net.minecraft.client.renderer.RegionRenderCache; //导入依赖的package包/类
@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());
}
 
开发者ID:iChun,项目名称:Blocksteps,代码行数:69,代码来源:ListedRenderChunkBlocksteps.java

示例3: renderBlock

import net.minecraft.client.renderer.RegionRenderCache; //导入依赖的package包/类
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);
            }
        }
    }
}
 
开发者ID:iChun,项目名称:Blocksteps,代码行数:42,代码来源:ListedRenderChunkBlocksteps.java


注:本文中的net.minecraft.client.renderer.RegionRenderCache类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。