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


Java DefaultVertexFormats.BLOCK属性代码示例

本文整理汇总了Java中net.minecraft.client.renderer.vertex.DefaultVertexFormats.BLOCK属性的典型用法代码示例。如果您正苦于以下问题:Java DefaultVertexFormats.BLOCK属性的具体用法?Java DefaultVertexFormats.BLOCK怎么用?Java DefaultVertexFormats.BLOCK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.minecraft.client.renderer.vertex.DefaultVertexFormats的用法示例。


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

示例1: RenderChunk

public RenderChunk(World worldIn, RenderGlobal renderGlobalIn, BlockPos blockPosIn, int indexIn)
{
    this.world = worldIn;
    this.renderGlobal = renderGlobalIn;
    this.index = indexIn;

    if (!blockPosIn.equals(this.getPosition()))
    {
        this.setPosition(blockPosIn);
    }

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

示例2: RenderChunk

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,代码行数:19,代码来源:RenderChunk.java

示例3: batchBlocks

private void batchBlocks() {
    Vec3i move = this.attachedPosition;
    if(move == null) {
        RayTraceResult res = getLookBlock(Minecraft.getMinecraft().player, false, true, 20);
        if(res != null) {
            move = res.getBlockPos();
        }
    }
    if(move == null || this.renderHelper == null) {
        batchDList = GLAllocation.generateDisplayLists(1);
        GlStateManager.glNewList(batchDList, GL11.GL_COMPILE);
        GlStateManager.glEndList();
        return;
    }
    batchDList = GLAllocation.generateDisplayLists(1);
    GlStateManager.enableBlend();
    Blending.DEFAULT.applyStateManager();
    GlStateManager.glNewList(batchDList, GL11.GL_COMPILE);
    Tessellator tes = Tessellator.getInstance();
    BufferBuilder vb = tes.getBuffer();

    BlockArrayRenderHelper.WorldBlockArrayRenderAccess access = renderHelper.getRenderAccess().move(renderHelper, move);
    BlockRendererDispatcher brd = Minecraft.getMinecraft().getBlockRendererDispatcher();
    VertexFormat blockFormat = DefaultVertexFormats.BLOCK;

    vb.begin(GL11.GL_QUADS, blockFormat);
    for (Map.Entry<BlockPos, BlockArrayRenderHelper.BakedBlockData> data : access.blockRenderData.entrySet()) {
        BlockPos offset = data.getKey();
        BlockArrayRenderHelper.BakedBlockData renderData = data.getValue();
        BlockArrayRenderHelper.SampleRenderState state = renderData.getSampleState();

        if(Minecraft.getMinecraft().world != null &&
                renderHelper.getBlocks().getPattern().get(offset.subtract(move)).matches(Minecraft.getMinecraft().world, offset, false)) {
            continue;
        }
        if(state.state.getBlock() != Blocks.AIR) {
            BlockArrayRenderHelper.TileEntityRenderData terd = state.renderData;
            if(terd != null && terd.tileEntity != null) {
                terd.tileEntity.setWorld(Minecraft.getMinecraft().world);
                terd.tileEntity.setPos(offset);
            }
            IBlockState actRenderState = state.state;
            actRenderState = actRenderState.getBlock().getActualState(actRenderState, access, offset);
            brd.renderBlock(actRenderState, offset, access, vb);
        }
    }
    vb.sortVertexData(
            (float) TileEntityRendererDispatcher.staticPlayerX,
            (float) TileEntityRendererDispatcher.staticPlayerY,
            (float) TileEntityRendererDispatcher.staticPlayerZ);
    tes.draw();
    GlStateManager.glEndList();
    Blending.DEFAULT.applyStateManager();
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:54,代码来源:BlockArrayPreviewRenderHelper.java


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