当前位置: 首页>>代码示例>>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;未经允许,请勿转载。