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


Java BlockRenderLayer类代码示例

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


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

示例1: renderBlockModel

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
public static void renderBlockModel(World world, BlockPos pos, IBlockState state) {
    VertexBuffer wr = Tessellator.getInstance().getBuffer();
    wr.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
    wr.setTranslation(-pos.getX(), -pos.getY(), -pos.getZ());
    BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
    BlockModelShapes modelShapes = blockrendererdispatcher.getBlockModelShapes();
    IBakedModel ibakedmodel = modelShapes.getModelForState(state);
    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    
    for(BlockRenderLayer layer : BlockRenderLayer.values()) {
        if(state.getBlock().canRenderInLayer(state, layer)) {
            ForgeHooksClient.setRenderLayer(layer);
            blockrendererdispatcher.getBlockModelRenderer().renderModel(world, ibakedmodel, state, pos, wr, true);
        }
    }
    ForgeHooksClient.setRenderLayer(null);
    wr.setTranslation(0, 0, 0);
    Tessellator.getInstance().draw();
}
 
开发者ID:jaredlll08,项目名称:Machines-and-Stuff,代码行数:20,代码来源:RenderAccumulator.java

示例2: renderChunkLayer

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
public void renderChunkLayer(BlockRenderLayer layer)
{
    if (this.initialized)
    {
        for (RenderChunk renderchunk : this.renderChunks)
        {
            net.minecraft.client.renderer.vertex.VertexBuffer vertexbuffer = renderchunk.getVertexBufferByLayer(layer.ordinal());
            GlStateManager.pushMatrix();
            this.preRenderChunk(renderchunk);
            renderchunk.multModelviewMatrix();
            vertexbuffer.bindBuffer();
            this.setupArrayPointers();
            vertexbuffer.drawArrays(7);
            GlStateManager.popMatrix();
        }

        OpenGlHelper.glBindBuffer(OpenGlHelper.GL_ARRAY_BUFFER, 0);
        GlStateManager.resetColor();
        this.renderChunks.clear();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:22,代码来源:VboRenderList.java

示例3: getQuads

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand)
{
    IBakedModel model;
    BlockRenderLayer layer = MinecraftForgeClient.getRenderLayer();
    if(layer == null)
    {
        return quads.get(Optional.fromNullable(side));
    }
    else if(!models.containsKey(Optional.of(layer)))
    {
        model = missing;
    }
    else
    {
        model = models.get(Optional.of(layer));
    }
    // assumes that child model will handle this state properly. FIXME?
    return model.getQuads(state, side, rand);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:MultiLayerModel.java

示例4: RenderChunk

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
public RenderChunk(World p_i47120_1_, RenderGlobal p_i47120_2_, int p_i47120_3_)
{
    for (int i = 0; i < this.mapEnumFacing.length; ++i)
    {
        this.mapEnumFacing[i] = new BlockPos.MutableBlockPos();
    }

    this.world = p_i47120_1_;
    this.renderGlobal = p_i47120_2_;
    this.index = p_i47120_3_;

    if (OpenGlHelper.useVbo())
    {
        for (int j = 0; j < BlockRenderLayer.values().length; ++j)
        {
            this.vertexBuffers[j] = new VertexBuffer(DefaultVertexFormats.BLOCK);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:RenderChunk.java

示例5: fixBlockLayer

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
private BlockRenderLayer fixBlockLayer(Block p_fixBlockLayer_1_, BlockRenderLayer p_fixBlockLayer_2_)
{
    if (this.isMipmaps)
    {
        if (p_fixBlockLayer_2_ == BlockRenderLayer.CUTOUT)
        {
            if (p_fixBlockLayer_1_ instanceof BlockRedstoneWire)
            {
                return p_fixBlockLayer_2_;
            }

            if (p_fixBlockLayer_1_ instanceof BlockCactus)
            {
                return p_fixBlockLayer_2_;
            }

            return BlockRenderLayer.CUTOUT_MIPPED;
        }
    }
    else if (p_fixBlockLayer_2_ == BlockRenderLayer.CUTOUT_MIPPED)
    {
        return BlockRenderLayer.CUTOUT;
    }

    return p_fixBlockLayer_2_;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:27,代码来源:RenderChunk.java

示例6: parseBlockRenderLayer

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
public BlockRenderLayer parseBlockRenderLayer(String p_parseBlockRenderLayer_1_, BlockRenderLayer p_parseBlockRenderLayer_2_)
{
    if (p_parseBlockRenderLayer_1_ == null)
    {
        return p_parseBlockRenderLayer_2_;
    }
    else
    {
        p_parseBlockRenderLayer_1_ = p_parseBlockRenderLayer_1_.toLowerCase().trim();
        BlockRenderLayer[] ablockrenderlayer = BlockRenderLayer.values();

        for (int i = 0; i < ablockrenderlayer.length; ++i)
        {
            BlockRenderLayer blockrenderlayer = ablockrenderlayer[i];

            if (p_parseBlockRenderLayer_1_.equals(blockrenderlayer.name().toLowerCase()))
            {
                return blockrenderlayer;
            }
        }

        return p_parseBlockRenderLayer_2_;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:ConnectedParser.java

示例7: MultiLayerBakedModel

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
public MultiLayerBakedModel(ImmutableMap<Optional<BlockRenderLayer>, IBakedModel> models, IBakedModel missing, ImmutableMap<TransformType, TRSRTransformation> cameraTransforms)
{
    this.models = models;
    this.cameraTransforms = cameraTransforms;
    this.missing = missing;
    if(models.containsKey(Optional.absent()))
    {
        base = models.get(Optional.absent());
    }
    else
    {
        base = missing;
    }
    ImmutableMap.Builder<Optional<EnumFacing>, ImmutableList<BakedQuad>> quadBuilder = ImmutableMap.builder();
    quadBuilder.put(Optional.<EnumFacing>absent(), buildQuads(models, Optional.<EnumFacing>absent()));
    for(EnumFacing side: EnumFacing.values())
    {
        quadBuilder.put(Optional.of(side), buildQuads(models, Optional.of(side)));
    }
    quads = quadBuilder.build();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:22,代码来源:MultiLayerModel.java

示例8: resortTransparency

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
public void resortTransparency(float x, float y, float z, ChunkCompileTaskGenerator generator)
{
    CompiledChunk compiledchunk = generator.getCompiledChunk();

    if (compiledchunk.getState() != null && !compiledchunk.isLayerEmpty(BlockRenderLayer.TRANSLUCENT))
    {
        this.preRenderBlocks(generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(BlockRenderLayer.TRANSLUCENT), this.position);
        generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(BlockRenderLayer.TRANSLUCENT).setVertexState(compiledchunk.getState());
        this.postRenderBlocks(BlockRenderLayer.TRANSLUCENT, x, y, z, generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(BlockRenderLayer.TRANSLUCENT), compiledchunk);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:RenderChunk.java

示例9: getListQuadsOverlay

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
public ListQuadsOverlay getListQuadsOverlay(BlockRenderLayer p_getListQuadsOverlay_1_)
{
    ListQuadsOverlay listquadsoverlay = this.listsQuadsOverlay[p_getListQuadsOverlay_1_.ordinal()];

    if (listquadsoverlay == null)
    {
        listquadsoverlay = new ListQuadsOverlay();
        this.listsQuadsOverlay[p_getListQuadsOverlay_1_.ordinal()] = listquadsoverlay;
    }

    return listquadsoverlay;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:RenderEnv.java

示例10: isTranslucentBlock

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
private static boolean isTranslucentBlock(ItemStack stack)
{
    if (stack == null)
    {
        return false;
    }
    else
    {
        Item item = stack.getItem();

        if (item == null)
        {
            return false;
        }
        else if (!(item instanceof ItemBlock))
        {
            return false;
        }
        else
        {
            ItemBlock itemblock = (ItemBlock)item;
            Block block = itemblock.getBlock();

            if (block == null)
            {
                return false;
            }
            else
            {
                BlockRenderLayer blockrenderlayer = block.getBlockLayer();
                return blockrenderlayer == BlockRenderLayer.TRANSLUCENT;
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:36,代码来源:Shaders.java

示例11: RegionRenderCacheBuilder

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
public RegionRenderCacheBuilder()
{
    this.worldRenderers[BlockRenderLayer.SOLID.ordinal()] = new VertexBuffer(2097152);
    this.worldRenderers[BlockRenderLayer.CUTOUT.ordinal()] = new VertexBuffer(131072);
    this.worldRenderers[BlockRenderLayer.CUTOUT_MIPPED.ordinal()] = new VertexBuffer(131072);
    this.worldRenderers[BlockRenderLayer.TRANSLUCENT.ordinal()] = new VertexBuffer(262144);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:RegionRenderCacheBuilder.java

示例12: renderChunkLayer

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
public void renderChunkLayer(BlockRenderLayer layer)
{
    if (this.initialized)
    {
        if (this.renderChunks.size() == 0)
        {
            return;
        }

        for (RenderChunk renderchunk : this.renderChunks)
        {
            ListedRenderChunk listedrenderchunk = (ListedRenderChunk)renderchunk;
            GlStateManager.pushMatrix();
            this.preRenderChunk(renderchunk);
            GlStateManager.callList(listedrenderchunk.getDisplayList(layer, listedrenderchunk.getCompiledChunk()));
            GlStateManager.popMatrix();
        }

        if (Config.isMultiTexture())
        {
            GlStateManager.bindCurrentTexture();
        }

        GlStateManager.resetColor();
        this.renderChunks.clear();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:28,代码来源:RenderList.java

示例13: resortTransparency

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
public void resortTransparency(float x, float y, float z, ChunkCompileTaskGenerator generator)
{
    CompiledChunk compiledchunk = generator.getCompiledChunk();

    if (compiledchunk.getState() != null && !compiledchunk.isLayerEmpty(BlockRenderLayer.TRANSLUCENT))
    {
        net.minecraft.client.renderer.VertexBuffer vertexbuffer = generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(BlockRenderLayer.TRANSLUCENT);
        this.preRenderBlocks(vertexbuffer, this.position);
        vertexbuffer.setVertexState(compiledchunk.getState());
        this.postRenderBlocks(BlockRenderLayer.TRANSLUCENT, x, y, z, vertexbuffer, compiledchunk);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:RenderChunk.java

示例14: postRenderBlocks

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
private void postRenderBlocks(BlockRenderLayer layer, float x, float y, float z, net.minecraft.client.renderer.VertexBuffer worldRendererIn, CompiledChunk compiledChunkIn)
{
    if (layer == BlockRenderLayer.TRANSLUCENT && !compiledChunkIn.isLayerEmpty(layer))
    {
        worldRendererIn.sortVertexData(x, y, z);
        compiledChunkIn.setState(worldRendererIn.getVertexState());
    }

    worldRendererIn.finishDrawing();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:11,代码来源:RenderChunk.java

示例15: uploadChunk

import net.minecraft.util.BlockRenderLayer; //导入依赖的package包/类
public ListenableFuture<Object> uploadChunk(final BlockRenderLayer p_188245_1_, final VertexBuffer p_188245_2_, final RenderChunk p_188245_3_, final CompiledChunk p_188245_4_, final double p_188245_5_)
{
    if (Minecraft.getMinecraft().isCallingFromMinecraftThread())
    {
        if (OpenGlHelper.useVbo())
        {
            this.uploadVertexBuffer(p_188245_2_, p_188245_3_.getVertexBufferByLayer(p_188245_1_.ordinal()));
        }
        else
        {
            this.uploadDisplayList(p_188245_2_, ((ListedRenderChunk)p_188245_3_).getDisplayList(p_188245_1_, p_188245_4_), p_188245_3_);
        }

        p_188245_2_.setTranslation(0.0D, 0.0D, 0.0D);
        return Futures.<Object>immediateFuture((Object)null);
    }
    else
    {
        ListenableFutureTask<Object> listenablefuturetask = ListenableFutureTask.<Object>create(new Runnable()
        {
            public void run()
            {
                ChunkRenderDispatcher.this.uploadChunk(p_188245_1_, p_188245_2_, p_188245_3_, p_188245_4_, p_188245_5_);
            }
        }, (Object)null);

        synchronized (this.queueChunkUploads)
        {
            this.queueChunkUploads.add(new ChunkRenderDispatcher.PendingUpload(listenablefuturetask, p_188245_5_));
            return listenablefuturetask;
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:34,代码来源:ChunkRenderDispatcher.java


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