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


Java TileEntityPiston.func_145861_a方法代码示例

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


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

示例1: setBlockBoundsBasedOnState

import net.minecraft.tileentity.TileEntityPiston; //导入方法依赖的package包/类
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
{
    TileEntityPiston var5 = this.func_149963_e(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_);

    if (var5 != null)
    {
        Block var6 = var5.func_145861_a();

        if (var6 == this || var6.getMaterial() == Material.air)
        {
            return;
        }

        var6.setBlockBoundsBasedOnState(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_);
        float var7 = var5.func_145860_a(0.0F);

        if (var5.func_145868_b())
        {
            var7 = 1.0F - var7;
        }

        int var8 = var5.func_145864_c();
        this.field_149759_B = var6.getBlockBoundsMinX() - (double)((float)Facing.offsetsXForSide[var8] * var7);
        this.field_149760_C = var6.getBlockBoundsMinY() - (double)((float)Facing.offsetsYForSide[var8] * var7);
        this.field_149754_D = var6.getBlockBoundsMinZ() - (double)((float)Facing.offsetsZForSide[var8] * var7);
        this.field_149755_E = var6.getBlockBoundsMaxX() - (double)((float)Facing.offsetsXForSide[var8] * var7);
        this.field_149756_F = var6.getBlockBoundsMaxY() - (double)((float)Facing.offsetsYForSide[var8] * var7);
        this.field_149757_G = var6.getBlockBoundsMaxZ() - (double)((float)Facing.offsetsZForSide[var8] * var7);
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:31,代码来源:BlockPistonMoving.java

示例2: renderTileEntityAt

import net.minecraft.tileentity.TileEntityPiston; //导入方法依赖的package包/类
public void renderTileEntityAt(TileEntityPiston p_147515_1_, double p_147515_2_, double p_147515_4_, double p_147515_6_, float p_147515_8_)
{
    Block var9 = p_147515_1_.func_145861_a();

    if (var9.getMaterial() != Material.air && p_147515_1_.func_145860_a(p_147515_8_) < 1.0F)
    {
        Tessellator var10 = Tessellator.instance;
        this.bindTexture(TextureMap.locationBlocksTexture);
        RenderHelper.disableStandardItemLighting();
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glDisable(GL11.GL_CULL_FACE);

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

        var10.startDrawingQuads();
        var10.setTranslation((double)((float)p_147515_2_ - (float)p_147515_1_.field_145851_c + p_147515_1_.func_145865_b(p_147515_8_)), (double)((float)p_147515_4_ - (float)p_147515_1_.field_145848_d + p_147515_1_.func_145862_c(p_147515_8_)), (double)((float)p_147515_6_ - (float)p_147515_1_.field_145849_e + p_147515_1_.func_145859_d(p_147515_8_)));
        var10.setColorOpaque_F(1.0F, 1.0F, 1.0F);

        if (var9 == Blocks.piston_head && p_147515_1_.func_145860_a(p_147515_8_) < 0.5F)
        {
            this.field_147516_b.renderPistonExtensionAllFaces(var9, p_147515_1_.field_145851_c, p_147515_1_.field_145848_d, p_147515_1_.field_145849_e, false);
        }
        else if (p_147515_1_.func_145867_d() && !p_147515_1_.func_145868_b())
        {
            Blocks.piston_head.func_150086_a(((BlockPistonBase)var9).func_150073_e());
            this.field_147516_b.renderPistonExtensionAllFaces(Blocks.piston_head, p_147515_1_.field_145851_c, p_147515_1_.field_145848_d, p_147515_1_.field_145849_e, p_147515_1_.func_145860_a(p_147515_8_) < 0.5F);
            Blocks.piston_head.func_150087_e();
            var10.setTranslation((double)((float)p_147515_2_ - (float)p_147515_1_.field_145851_c), (double)((float)p_147515_4_ - (float)p_147515_1_.field_145848_d), (double)((float)p_147515_6_ - (float)p_147515_1_.field_145849_e));
            this.field_147516_b.renderPistonBaseAllFaces(var9, p_147515_1_.field_145851_c, p_147515_1_.field_145848_d, p_147515_1_.field_145849_e);
        }
        else
        {
            this.field_147516_b.renderBlockAllFaces(var9, p_147515_1_.field_145851_c, p_147515_1_.field_145848_d, p_147515_1_.field_145849_e);
        }

        var10.setTranslation(0.0D, 0.0D, 0.0D);
        var10.draw();
        RenderHelper.enableStandardItemLighting();
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:49,代码来源:TileEntityRendererPiston.java


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