當前位置: 首頁>>代碼示例>>Java>>正文


Java BlockRenderLayer.values方法代碼示例

本文整理匯總了Java中net.minecraft.util.BlockRenderLayer.values方法的典型用法代碼示例。如果您正苦於以下問題:Java BlockRenderLayer.values方法的具體用法?Java BlockRenderLayer.values怎麽用?Java BlockRenderLayer.values使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.util.BlockRenderLayer的用法示例。


在下文中一共展示了BlockRenderLayer.values方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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

示例3: 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

示例4: process

import net.minecraft.util.BlockRenderLayer; //導入方法依賴的package包/類
@Override
public MultiLayerModel process(ImmutableMap<String, String> customData)
{
    ImmutableMap.Builder<Optional<BlockRenderLayer>, ModelResourceLocation> builder = ImmutableMap.builder();
    for(String key : customData.keySet())
    {
        if("base".equals(key))
        {
            builder.put(Optional.<BlockRenderLayer>absent(), getLocation(customData.get(key)));
        }
        for(BlockRenderLayer layer : BlockRenderLayer.values())
        {
            if(layer.toString().equals(key))
            {
                builder.put(Optional.of(layer), getLocation(customData.get(key)));
            }
        }
    }
    ImmutableMap<Optional<BlockRenderLayer>, ModelResourceLocation> models = builder.build();
    if(models.isEmpty()) return INSTANCE;
    return new MultiLayerModel(models);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:23,代碼來源:MultiLayerModel.java

示例5: deleteGlResources

import net.minecraft.util.BlockRenderLayer; //導入方法依賴的package包/類
public void deleteGlResources()
{
    this.stopCompileTask();
    this.world = null;

    for (int i = 0; i < BlockRenderLayer.values().length; ++i)
    {
        if (this.vertexBuffers[i] != null)
        {
            this.vertexBuffers[i].deleteGlBuffers();
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:14,代碼來源:RenderChunk.java


注:本文中的net.minecraft.util.BlockRenderLayer.values方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。