當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。