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


Java TileEntityBanner.getWorld方法代码示例

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


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

示例1: renderTileEntityAt

import net.minecraft.tileentity.TileEntityBanner; //导入方法依赖的package包/类
public void renderTileEntityAt(TileEntityBanner te, double x, double y, double z, float partialTicks, int destroyStage)
{
    boolean flag = te.getWorld() != null;
    boolean flag1 = !flag || te.getBlockType() == Blocks.standing_banner;
    int i = flag ? te.getBlockMetadata() : 0;
    long j = flag ? te.getWorld().getTotalWorldTime() : 0L;
    GlStateManager.pushMatrix();
    float f = 0.6666667F;

    if (flag1)
    {
        GlStateManager.translate((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F);
        float f1 = (float)(i * 360) / 16.0F;
        GlStateManager.rotate(-f1, 0.0F, 1.0F, 0.0F);
        this.bannerModel.bannerStand.showModel = true;
    }
    else
    {
        float f2 = 0.0F;

        if (i == 2)
        {
            f2 = 180.0F;
        }

        if (i == 4)
        {
            f2 = 90.0F;
        }

        if (i == 5)
        {
            f2 = -90.0F;
        }

        GlStateManager.translate((float)x + 0.5F, (float)y - 0.25F * f, (float)z + 0.5F);
        GlStateManager.rotate(-f2, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.0F, -0.3125F, -0.4375F);
        this.bannerModel.bannerStand.showModel = false;
    }

    BlockPos blockpos = te.getPos();
    float f3 = (float)(blockpos.getX() * 7 + blockpos.getY() * 9 + blockpos.getZ() * 13) + (float)j + partialTicks;
    this.bannerModel.bannerSlate.rotateAngleX = (-0.0125F + 0.01F * MathHelper.cos(f3 * (float)Math.PI * 0.02F)) * (float)Math.PI;
    GlStateManager.enableRescaleNormal();
    ResourceLocation resourcelocation = this.func_178463_a(te);

    if (resourcelocation != null)
    {
        this.bindTexture(resourcelocation);
        GlStateManager.pushMatrix();
        GlStateManager.scale(f, -f, -f);
        this.bannerModel.renderBanner();
        GlStateManager.popMatrix();
    }

    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.popMatrix();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:60,代码来源:TileEntityBannerRenderer.java

示例2: renderTileEntityAt

import net.minecraft.tileentity.TileEntityBanner; //导入方法依赖的package包/类
public void renderTileEntityAt(TileEntityBanner te, double x, double y, double z, float partialTicks, int destroyStage)
{
    boolean flag = te.getWorld() != null;
    boolean flag1 = !flag || te.getBlockType() == Blocks.STANDING_BANNER;
    int i = flag ? te.getBlockMetadata() : 0;
    long j = flag ? te.getWorld().getTotalWorldTime() : 0L;
    GlStateManager.pushMatrix();
    float f = 0.6666667F;

    if (flag1)
    {
        GlStateManager.translate((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F);
        float f1 = (float)(i * 360) / 16.0F;
        GlStateManager.rotate(-f1, 0.0F, 1.0F, 0.0F);
        this.bannerModel.bannerStand.showModel = true;
    }
    else
    {
        float f2 = 0.0F;

        if (i == 2)
        {
            f2 = 180.0F;
        }

        if (i == 4)
        {
            f2 = 90.0F;
        }

        if (i == 5)
        {
            f2 = -90.0F;
        }

        GlStateManager.translate((float)x + 0.5F, (float)y - 0.16666667F, (float)z + 0.5F);
        GlStateManager.rotate(-f2, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.0F, -0.3125F, -0.4375F);
        this.bannerModel.bannerStand.showModel = false;
    }

    BlockPos blockpos = te.getPos();
    float f3 = (float)(blockpos.getX() * 7 + blockpos.getY() * 9 + blockpos.getZ() * 13) + (float)j + partialTicks;
    this.bannerModel.bannerSlate.rotateAngleX = (-0.0125F + 0.01F * MathHelper.cos(f3 * (float)Math.PI * 0.02F)) * (float)Math.PI;
    GlStateManager.enableRescaleNormal();
    ResourceLocation resourcelocation = this.getBannerResourceLocation(te);

    if (resourcelocation != null)
    {
        this.bindTexture(resourcelocation);
        GlStateManager.pushMatrix();
        GlStateManager.scale(0.6666667F, -0.6666667F, -0.6666667F);
        this.bannerModel.renderBanner();
        GlStateManager.popMatrix();
    }

    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.popMatrix();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:60,代码来源:TileEntityBannerRenderer.java


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