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


Java Minecraft.isAmbientOcclusionEnabled方法代碼示例

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


在下文中一共展示了Minecraft.isAmbientOcclusionEnabled方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: drawBatch

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public void drawBatch(int p_drawBatch_1_)
{
    this.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    RenderHelper.disableStandardItemLighting();
    GlStateManager.blendFunc(770, 771);
    GlStateManager.enableBlend();
    GlStateManager.disableCull();

    if (Minecraft.isAmbientOcclusionEnabled())
    {
        GlStateManager.shadeModel(7425);
    }
    else
    {
        GlStateManager.shadeModel(7424);
    }

    if (p_drawBatch_1_ > 0)
    {
        this.batchBuffer.getBuffer().sortVertexData((float)staticPlayerX, (float)staticPlayerY, (float)staticPlayerZ);
    }

    this.batchBuffer.draw();
    RenderHelper.enableStandardItemLighting();
    this.drawingBatch = false;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:27,代碼來源:TileEntityRendererDispatcher.java

示例2: doRenderLayer

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void doRenderLayer(AbstractClientPlayer entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
    if (!Arrays.asList(contributors.uuid).contains(entitylivingbaseIn.getUniqueID().toString())) return;
    if (!entitylivingbaseIn.isWearing(EnumPlayerModelParts.CAPE)) return;
    GlStateManager.pushMatrix();
    GlStateManager.enableBlend();
    GlStateManager.disableCull();
    RenderHelper.disableStandardItemLighting();
    if (Minecraft.isAmbientOcclusionEnabled()) {
        GlStateManager.shadeModel(GL11.GL_SMOOTH);
    } else {
        GlStateManager.shadeModel(GL11.GL_FLAT);
    }
    GlStateManager.translate(0, -0.015f, 0);
    if (!entitylivingbaseIn.inventory.armorInventory.get(3).isEmpty()) GlStateManager.translate(0, -0.02f, 0);
    if (entitylivingbaseIn.isSneaking()) GlStateManager.translate(0, 0.27, 0);
    GlStateManager.rotate(90, 0, 1, 0);
    GlStateManager.rotate(180, 1, 0, 0);
    GlStateManager.rotate(netHeadYaw, 0, -1, 0);
    GlStateManager.rotate(headPitch, 0, 0, -1);

    Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    Calendar calendar = Calendar.getInstance();
    if (calendar.get(Calendar.MONTH) == Calendar.OCTOBER) {
        spookyScarySkeletons();
    } else if (calendar.get(Calendar.MONTH) == Calendar.DECEMBER) {
        itsSnowyHere();
    } else {
        Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(ClientProxy.ears_baked, 0.5f, 255, 255, 255);
    }
    RenderHelper.enableStandardItemLighting();
    GlStateManager.depthMask(true);
    GlStateManager.popMatrix();
}
 
開發者ID:Buuz135,項目名稱:Industrial-Foregoing,代碼行數:36,代碼來源:ContributorsCatEarsRender.java

示例3: renderModel

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public boolean renderModel(IBlockAccess blockAccessIn, IBakedModel modelIn, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides)
{
    boolean flag = Minecraft.isAmbientOcclusionEnabled() && blockStateIn.getBlock().getLightValue() == 0 && modelIn.isAmbientOcclusion();

    try
    {
        Block block = blockStateIn.getBlock();
        return flag ? this.renderModelAmbientOcclusion(blockAccessIn, modelIn, block, blockPosIn, worldRendererIn, checkSides) : this.renderModelStandard(blockAccessIn, modelIn, block, blockPosIn, worldRendererIn, checkSides);
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block model");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Block model being tesselated");
        CrashReportCategory.addBlockInfo(crashreportcategory, blockPosIn, blockStateIn);
        crashreportcategory.addCrashSection("Using AO", Boolean.valueOf(flag));
        throw new ReportedException(crashreport);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:19,代碼來源:BlockModelRenderer.java

示例4: renderModel

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public boolean renderModel(IBlockAccess blockAccessIn, IBakedModel modelIn, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides)
{
    boolean flag = Minecraft.isAmbientOcclusionEnabled() && blockStateIn.getBlock().getLightValue() == 0 && modelIn.isAmbientOcclusion();

    try
    {
        Block block = blockStateIn.getBlock();

        if (Config.isTreesSmart() && blockStateIn.getBlock() instanceof BlockLeavesBase)
        {
            modelIn = SmartLeaves.getLeavesModel(modelIn);
        }

        return flag ? this.renderModelAmbientOcclusion(blockAccessIn, modelIn, block, blockStateIn, blockPosIn, worldRendererIn, checkSides) : this.renderModelStandard(blockAccessIn, modelIn, block, blockStateIn, blockPosIn, worldRendererIn, checkSides);
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block model");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Block model being tesselated");
        CrashReportCategory.addBlockInfo(crashreportcategory, blockPosIn, blockStateIn);
        crashreportcategory.addCrashSection("Using AO", Boolean.valueOf(flag));
        throw new ReportedException(crashreport);
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:25,代碼來源:BlockModelRenderer.java

示例5: renderModel

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public boolean renderModel(IBlockAccess blockAccessIn, IBakedModel modelIn, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides)
{
    boolean flag = Minecraft.isAmbientOcclusionEnabled() && blockStateIn.getBlock().getLightValue() == 0 && modelIn.isAmbientOcclusion();

    try
    {
        Block block = blockStateIn.getBlock();
        return flag ? this.renderModelAmbientOcclusion(blockAccessIn, modelIn, block, blockStateIn, blockPosIn, worldRendererIn, checkSides) : this.renderModelStandard(blockAccessIn, modelIn, block, blockStateIn, blockPosIn, worldRendererIn, checkSides);
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block model");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Block model being tesselated");
        CrashReportCategory.addBlockInfo(crashreportcategory, blockPosIn, blockStateIn);
        crashreportcategory.addCrashSection("Using AO", Boolean.valueOf(flag));
        throw new ReportedException(crashreport);
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:19,代碼來源:BlockModelRenderer.java

示例6: renderModel

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public boolean renderModel(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, boolean checkSides, long rand)
{
    boolean flag = Minecraft.isAmbientOcclusionEnabled() && stateIn.getLightValue() == 0 && modelIn.isAmbientOcclusion();

    try
    {
        return flag ? this.renderModelSmooth(worldIn, modelIn, stateIn, posIn, buffer, checkSides, rand) : this.renderModelFlat(worldIn, modelIn, stateIn, posIn, buffer, checkSides, rand);
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block model");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Block model being tesselated");
        CrashReportCategory.addBlockInfo(crashreportcategory, posIn, stateIn);
        crashreportcategory.addCrashSection("Using AO", Boolean.valueOf(flag));
        throw new ReportedException(crashreport);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:18,代碼來源:BlockModelRenderer.java

示例7: renderStandardBlock

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public boolean renderStandardBlock(Block block, int i, int j, int k)
{
    int l = block.colorMultiplier(blockAccess, i, j, k);
    float f = (float)(l >> 16 & 0xff) / 255F;
    float f1 = (float)(l >> 8 & 0xff) / 255F;
    float f2 = (float)(l & 0xff) / 255F;
    if(EntityRenderer.anaglyphEnabled)
    {
        float f3 = (f * 30F + f1 * 59F + f2 * 11F) / 100F;
        float f4 = (f * 30F + f1 * 70F) / 100F;
        float f5 = (f * 30F + f2 * 70F) / 100F;
        f = f3;
        f1 = f4;
        f2 = f5;
    }
	if(block == Block.wood)
	{
		setTextureOrientation(true,blockAccess.getBlockMetadata(i, j, k));
	}
    if(Minecraft.isAmbientOcclusionEnabled() && Block.lightValue[block.blockID] == 0)
    {
        return renderStandardBlockWithAmbientOcclusion(block, i, j, k, f, f1, f2);
    } else
    {
        return renderStandardBlockWithColorMultiplier(block, i, j, k, f, f1, f2);
    }
}
 
開發者ID:jd-lang,項目名稱:betaexpansion,代碼行數:28,代碼來源:RenderBlocks.java

示例8: renderTileEntityAt

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@Override
public final void renderTileEntityAt(T te, double x, double y, double z, float partialTicks, int destroyStage)
{
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer VertexBuffer = tessellator.getBuffer();
    this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    RenderHelper.disableStandardItemLighting();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GlStateManager.enableBlend();
    GlStateManager.disableCull();

    if (Minecraft.isAmbientOcclusionEnabled())
    {
        GlStateManager.shadeModel(GL11.GL_SMOOTH);
    }
    else
    {
        GlStateManager.shadeModel(GL11.GL_FLAT);
    }

    VertexBuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);

    renderTileEntityFast(te, x, y, z, partialTicks, destroyStage, VertexBuffer);
    VertexBuffer.setTranslation(0, 0, 0);

    tessellator.draw();

    RenderHelper.enableStandardItemLighting();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:30,代碼來源:FastTESR.java

示例9: func_31070_a

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public void func_31070_a(TileEntityPiston tileentitypiston, double d, double d1, double d2, 
        float f)
{
    Block block = Block.blocksList[tileentitypiston.getStoredBlockID()];
    if(block != null && tileentitypiston.func_31008_a(f) < 1.0F)
    {
        Tessellator tessellator = Tessellator.instance;
        if(block.getRenderBlockPass()==2)
        {
            bindTextureByName("/betaexpansion/be_blocks.png");
        }else
        {
        	bindTextureByName("/terrain.png");
        }
        RenderHelper.disableStandardItemLighting();
        GL11.glBlendFunc(770, 771);
        GL11.glEnable(3042 /*GL_BLEND*/);
        GL11.glDisable(2884 /*GL_CULL_FACE*/);
        if(Minecraft.isAmbientOcclusionEnabled())
        {
            GL11.glShadeModel(7425 /*GL_SMOOTH*/);
        } else
        {
            GL11.glShadeModel(7424 /*GL_FLAT*/);
        }
        tessellator.startDrawingQuads();
        tessellator.setTranslationD(((float)d - (float)tileentitypiston.xCoord) + tileentitypiston.func_31017_b(f), ((float)d1 - (float)tileentitypiston.yCoord) + tileentitypiston.func_31014_c(f), ((float)d2 - (float)tileentitypiston.zCoord) + tileentitypiston.func_31013_d(f));
        tessellator.setColorOpaque(1, 1, 1);
        if(block == Block.pistonExtension && tileentitypiston.func_31008_a(f) < 0.5F)
        {
            field_31071_b.renderPistonExtensionWithAllFaces(block, tileentitypiston.xCoord, tileentitypiston.yCoord, tileentitypiston.zCoord, false, false);
        } else
        if(block == BEBlocks.launcherExtension && tileentitypiston.func_31008_a(f) < 0.5F)
        {
        	field_31071_b.renderPistonExtensionWithAllFaces(block, tileentitypiston.xCoord, tileentitypiston.yCoord, tileentitypiston.zCoord, false, true);
        }else
        if(tileentitypiston.func_31012_k() && !tileentitypiston.func_31015_b())
        {
            Block.pistonExtension.func_31052_a_(((BlockPistonBase)block).func_31040_i());
            if(block == BEBlocks.launcherBase || block == BEBlocks.launcherExtension)
            {
            	field_31071_b.renderPistonExtensionWithAllFaces(BEBlocks.launcherExtension, tileentitypiston.xCoord, tileentitypiston.yCoord, tileentitypiston.zCoord, tileentitypiston.func_31008_a(f) < 0.5F, true);
            }else
            {
            	field_31071_b.renderPistonExtensionWithAllFaces(Block.pistonExtension, tileentitypiston.xCoord, tileentitypiston.yCoord, tileentitypiston.zCoord, tileentitypiston.func_31008_a(f) < 0.5F, false);
            }
            Block.pistonExtension.func_31051_a();
            tessellator.setTranslationD((float)d - (float)tileentitypiston.xCoord, (float)d1 - (float)tileentitypiston.yCoord, (float)d2 - (float)tileentitypiston.zCoord);
            field_31071_b.renderPistonBaseWithAllFaces(block, tileentitypiston.xCoord, tileentitypiston.yCoord, tileentitypiston.zCoord);
        } else
        {
            field_31071_b.renderBlockWithAllFaces(block, tileentitypiston.xCoord, tileentitypiston.yCoord, tileentitypiston.zCoord);
        }
        tessellator.setTranslationD(0.0D, 0.0D, 0.0D);
        tessellator.draw();
        RenderHelper.enableStandardItemLighting();
    }
}
 
開發者ID:jd-lang,項目名稱:betaexpansion,代碼行數:59,代碼來源:TileEntityRendererPiston.java

示例10: render

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public void render( double x, double y, double z)
{
    if(child==null)
    {
        parent.connectionLines.remove(this);
        return;
    }

    GlStateManager.pushMatrix();
    GlStateManager.pushAttrib();
    //if(dim!=Minecraft.getMinecraft().theWorld.provider.getDimension())return;
    Minecraft.getMinecraft().getTextureManager().bindTexture(this.type.texture);
    Tessellator tessellator = Tessellator.getInstance();
    //tessellator.getBuffer().setTranslation(x,y,x);
    GlStateManager.translate(x,y,z);

    GL11.glEnable(GL11.GL_BLEND);
    GlStateManager.enableAlpha();

    //long angle = (System.currentTimeMillis() / 10) % 360;
    //GlStateManager.translate(0, 0.07 * Math.sin(Math.PI * angle / 180), 0);
    //GlStateManager.rotate(-angle, 1, 1, 1);

    GlStateManager.rotate(180, 1, 0, 0);


    RenderHelper.disableStandardItemLighting();

    GlStateManager.translate(0.33D*parent.x+0.1666,-0.08,-0.33D*parent.z-0.1666);
    GlStateManager.rotate(90+(float)heading, 0, 1, 0);


    if (Minecraft.isAmbientOcclusionEnabled()) {
        GlStateManager.shadeModel(GL11.GL_SMOOTH);
    } else {
        GlStateManager.shadeModel(GL11.GL_FLAT);
    }
    //GlStateManager.translate(-(pX+cX)/2,-(pY+cY)/2+0.5,-(pZ+cZ)/2);

    Color newColor = new Color(this.parent.getSignal().type.color);

    tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
    int state = (int)(System.currentTimeMillis()/100)%4+1;
    tessellator.getBuffer().pos(width/2,0,0).tex(0.25D*state,length).color(newColor.getRed(),newColor.getGreen(),newColor.getBlue(),newColor.getAlpha()).endVertex();
    tessellator.getBuffer().pos(width/2,0,length).tex(0.25D*state,0).color(newColor.getRed(),newColor.getGreen(),newColor.getBlue(),newColor.getAlpha()).endVertex();
    tessellator.getBuffer().pos(-width/2,0,length).tex(0.25D*(state-1),0).color(newColor.getRed(),newColor.getGreen(),newColor.getBlue(),newColor.getAlpha()).endVertex();
    tessellator.getBuffer().pos(-width/2,0,0).tex(0.25D*(state-1),length).color(newColor.getRed(),newColor.getGreen(),newColor.getBlue(),newColor.getAlpha()).endVertex();
    tessellator.draw();

    GL11.glDisable(GL11.GL_BLEND);
    RenderHelper.enableStandardItemLighting();
    GlStateManager.popMatrix();
    GlStateManager.popAttrib();

}
 
開發者ID:Drazuam,項目名稱:RunicArcana,代碼行數:56,代碼來源:DustConnectionLine.java

示例11: renderTileEntityAt

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public void renderTileEntityAt(TileEntityPiston te, double x, double y, double z, float partialTicks, int destroyStage)
{
    BlockPos blockpos = te.getPos();
    IBlockState iblockstate = te.getPistonState();
    Block block = iblockstate.getBlock();

    if (block.getMaterial() != Material.air && te.getProgress(partialTicks) < 1.0F)
    {
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        this.bindTexture(TextureMap.locationBlocksTexture);
        RenderHelper.disableStandardItemLighting();
        GlStateManager.blendFunc(770, 771);
        GlStateManager.enableBlend();
        GlStateManager.disableCull();

        if (Minecraft.isAmbientOcclusionEnabled())
        {
            GlStateManager.shadeModel(7425);
        }
        else
        {
            GlStateManager.shadeModel(7424);
        }

        worldrenderer.begin(7, DefaultVertexFormats.BLOCK);
        worldrenderer.setTranslation((double)((float)x - (float)blockpos.getX() + te.getOffsetX(partialTicks)), (double)((float)y - (float)blockpos.getY() + te.getOffsetY(partialTicks)), (double)((float)z - (float)blockpos.getZ() + te.getOffsetZ(partialTicks)));
        World world = this.getWorld();

        if (block == Blocks.piston_head && te.getProgress(partialTicks) < 0.5F)
        {
            iblockstate = iblockstate.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(true));
            this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate, world, blockpos), iblockstate, blockpos, worldrenderer, true);
        }
        else if (te.shouldPistonHeadBeRendered() && !te.isExtending())
        {
            BlockPistonExtension.EnumPistonType blockpistonextension$enumpistontype = block == Blocks.sticky_piston ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT;
            IBlockState iblockstate1 = Blocks.piston_head.getDefaultState().withProperty(BlockPistonExtension.TYPE, blockpistonextension$enumpistontype).withProperty(BlockPistonExtension.FACING, iblockstate.getValue(BlockPistonBase.FACING));
            iblockstate1 = iblockstate1.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(te.getProgress(partialTicks) >= 0.5F));
            this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate1, world, blockpos), iblockstate1, blockpos, worldrenderer, true);
            worldrenderer.setTranslation((double)((float)x - (float)blockpos.getX()), (double)((float)y - (float)blockpos.getY()), (double)((float)z - (float)blockpos.getZ()));
            iblockstate.withProperty(BlockPistonBase.EXTENDED, Boolean.valueOf(true));
            this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate, world, blockpos), iblockstate, blockpos, worldrenderer, true);
        }
        else
        {
            this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate, world, blockpos), iblockstate, blockpos, worldrenderer, false);
        }

        worldrenderer.setTranslation(0.0D, 0.0D, 0.0D);
        tessellator.draw();
        RenderHelper.enableStandardItemLighting();
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:55,代碼來源:TileEntityPistonRenderer.java

示例12: renderTileEntityAt

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public void renderTileEntityAt(TileEntityPiston te, double x, double y, double z, float partialTicks, int destroyStage)
{
    BlockPos blockpos = te.getPos();
    IBlockState iblockstate = te.getPistonState();
    Block block = iblockstate.getBlock();

    if (iblockstate.getMaterial() != Material.AIR && te.getProgress(partialTicks) < 1.0F)
    {
        Tessellator tessellator = Tessellator.getInstance();
        VertexBuffer vertexbuffer = tessellator.getBuffer();
        this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        RenderHelper.disableStandardItemLighting();
        GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
        GlStateManager.enableBlend();
        GlStateManager.disableCull();

        if (Minecraft.isAmbientOcclusionEnabled())
        {
            GlStateManager.shadeModel(7425);
        }
        else
        {
            GlStateManager.shadeModel(7424);
        }

        vertexbuffer.begin(7, DefaultVertexFormats.BLOCK);
        vertexbuffer.setTranslation(x - (double)blockpos.getX() + (double)te.getOffsetX(partialTicks), y - (double)blockpos.getY() + (double)te.getOffsetY(partialTicks), z - (double)blockpos.getZ() + (double)te.getOffsetZ(partialTicks));
        World world = this.getWorld();

        if (block == Blocks.PISTON_HEAD && te.getProgress(partialTicks) <= 0.25F)
        {
            iblockstate = iblockstate.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(true));
            this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, true);
        }
        else if (te.shouldPistonHeadBeRendered() && !te.isExtending())
        {
            BlockPistonExtension.EnumPistonType blockpistonextension$enumpistontype = block == Blocks.STICKY_PISTON ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT;
            IBlockState iblockstate1 = Blocks.PISTON_HEAD.getDefaultState().withProperty(BlockPistonExtension.TYPE, blockpistonextension$enumpistontype).withProperty(BlockPistonExtension.FACING, iblockstate.getValue(BlockPistonBase.FACING));
            iblockstate1 = iblockstate1.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(te.getProgress(partialTicks) >= 0.5F));
            this.renderStateModel(blockpos, iblockstate1, vertexbuffer, world, true);
            vertexbuffer.setTranslation(x - (double)blockpos.getX(), y - (double)blockpos.getY(), z - (double)blockpos.getZ());
            iblockstate = iblockstate.withProperty(BlockPistonBase.EXTENDED, Boolean.valueOf(true));
            this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, true);
        }
        else
        {
            this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, false);
        }

        vertexbuffer.setTranslation(0.0D, 0.0D, 0.0D);
        tessellator.draw();
        RenderHelper.enableStandardItemLighting();
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:55,代碼來源:TileEntityPistonRenderer.java

示例13: renderModel

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public boolean renderModel(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, boolean checkSides, long rand)
{
    boolean flag = Minecraft.isAmbientOcclusionEnabled() && stateIn.getLightValue() == 0 && modelIn.isAmbientOcclusion();

    try
    {
        if (Config.isShaders())
        {
            SVertexBuilder.pushEntity(stateIn, posIn, worldIn, buffer);
        }

        if (!Config.isAlternateBlocks())
        {
            rand = 0L;
        }

        RenderEnv renderenv = buffer.getRenderEnv(worldIn, stateIn, posIn);
        modelIn = BlockModelCustomizer.getRenderModel(modelIn, stateIn, renderenv);
        boolean flag1 = flag ? this.renderModelSmooth(worldIn, modelIn, stateIn, posIn, buffer, checkSides, rand) : this.renderModelFlat(worldIn, modelIn, stateIn, posIn, buffer, checkSides, rand);

        if (flag1)
        {
            this.renderOverlayModels(worldIn, modelIn, stateIn, posIn, buffer, checkSides, rand, renderenv, flag);
        }

        if (Config.isShaders())
        {
            SVertexBuilder.popEntity(buffer);
        }

        return flag1;
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block model");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Block model being tesselated");
        CrashReportCategory.addBlockInfo(crashreportcategory, posIn, stateIn);
        crashreportcategory.addCrashSection("Using AO", Boolean.valueOf(flag));
        throw new ReportedException(crashreport);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:42,代碼來源:BlockModelRenderer.java

示例14: renderTileEntityAt

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public void renderTileEntityAt(TileEntityPiston te, double x, double y, double z, float partialTicks, int destroyStage)
{
    if(blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
    BlockPos blockpos = te.getPos();
    IBlockState iblockstate = te.getPistonState();
    Block block = iblockstate.getBlock();

    if (iblockstate.getMaterial() != Material.AIR && te.getProgress(partialTicks) < 1.0F)
    {
        Tessellator tessellator = Tessellator.getInstance();
        VertexBuffer vertexbuffer = tessellator.getBuffer();
        this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        RenderHelper.disableStandardItemLighting();
        GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
        GlStateManager.enableBlend();
        GlStateManager.disableCull();

        if (Minecraft.isAmbientOcclusionEnabled())
        {
            GlStateManager.shadeModel(7425);
        }
        else
        {
            GlStateManager.shadeModel(7424);
        }

        vertexbuffer.begin(7, DefaultVertexFormats.BLOCK);
        vertexbuffer.setTranslation((double)((float)x - (float)blockpos.getX() + te.getOffsetX(partialTicks)), (double)((float)y - (float)blockpos.getY() + te.getOffsetY(partialTicks)), (double)((float)z - (float)blockpos.getZ() + te.getOffsetZ(partialTicks)));
        World world = this.getWorld();

        if (block == Blocks.PISTON_HEAD && te.getProgress(partialTicks) < 0.5F)
        {
            iblockstate = iblockstate.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(true));
            this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, true);
        }
        else if (te.shouldPistonHeadBeRendered() && !te.isExtending())
        {
            BlockPistonExtension.EnumPistonType blockpistonextension$enumpistontype = block == Blocks.STICKY_PISTON ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT;
            IBlockState iblockstate1 = Blocks.PISTON_HEAD.getDefaultState().withProperty(BlockPistonExtension.TYPE, blockpistonextension$enumpistontype).withProperty(BlockPistonExtension.FACING, iblockstate.getValue(BlockPistonBase.FACING));
            iblockstate1 = iblockstate1.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(te.getProgress(partialTicks) >= 0.5F));
            this.renderStateModel(blockpos, iblockstate1, vertexbuffer, world, true);
            vertexbuffer.setTranslation((double)((float)x - (float)blockpos.getX()), (double)((float)y - (float)blockpos.getY()), (double)((float)z - (float)blockpos.getZ()));
            iblockstate = iblockstate.withProperty(BlockPistonBase.EXTENDED, Boolean.valueOf(true));
            this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, true);
        }
        else
        {
            this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, false);
        }

        vertexbuffer.setTranslation(0.0D, 0.0D, 0.0D);
        tessellator.draw();
        RenderHelper.enableStandardItemLighting();
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:56,代碼來源:TileEntityPistonRenderer.java


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